Skip to content

Commit b244319

Browse files
committed
rollup merge of rust-lang#20568: huonw/ungate-AT-globs
These aren't in their final form, but are all aiming to be part of 1.0, so at the very least encouraging usage now to find the bugs is nice. Also, the widespread roll-out of associated types in the standard library indicates they're getting good, and it's lame to have to activate a feature in essentially every crate ever.
2 parents cda6acb + 3e9d593 commit b244319

File tree

186 files changed

+37
-409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+37
-409
lines changed

src/librustc_driver/driver.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ pub fn phase_2_configure_and_expand(sess: &Session,
272272
}
273273
let cfg = syntax::ext::expand::ExpansionConfig {
274274
crate_name: crate_name.to_string(),
275-
deriving_hash_type_parameter: sess.features.borrow().default_type_params,
276275
enable_quotes: sess.features.borrow().quote,
277276
recursion_limit: sess.recursion_limit.get(),
278277
};

src/librustc_llvm/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#![feature(globs)]
2525
#![feature(link_args)]
2626
#![feature(unboxed_closures)]
27+
#![feature(old_orphan_check)]
2728

2829
extern crate libc;
2930

src/librustc_resolve/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#![feature(globs, phase, slicing_syntax)]
2020
#![feature(rustc_diagnostic_macros)]
2121
#![feature(associated_types)]
22+
#![feature(old_orphan_check)]
2223

2324
#[phase(plugin, link)] extern crate log;
2425
#[phase(plugin, link)] extern crate syntax;

src/librustc_typeck/astconv.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -361,14 +361,6 @@ fn create_substs_for_ast_path<'tcx>(
361361
supplied_ty_param_count)[]);
362362
}
363363

364-
if supplied_ty_param_count > required_ty_param_count
365-
&& !this.tcx().sess.features.borrow().default_type_params {
366-
span_err!(this.tcx().sess, span, E0108,
367-
"default type parameters are experimental and possibly buggy");
368-
span_help!(this.tcx().sess, span,
369-
"add #![feature(default_type_params)] to the crate attributes to enable");
370-
}
371-
372364
let mut substs = Substs::new_type(types, regions);
373365

374366
match self_ty {

src/libsyntax/ext/deriving/hash.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,14 @@ pub fn expand_deriving_hash<F>(cx: &mut ExtCtxt,
2525
F: FnOnce(P<Item>),
2626
{
2727

28-
let (path, generics, args) = if cx.ecfg.deriving_hash_type_parameter {
29-
(Path::new_(vec!("std", "hash", "Hash"), None,
30-
vec!(box Literal(Path::new_local("__S"))), true),
31-
LifetimeBounds {
32-
lifetimes: Vec::new(),
33-
bounds: vec!(("__S",
34-
vec!(Path::new(vec!("std", "hash", "Writer"))))),
35-
},
36-
Path::new_local("__S"))
37-
} else {
38-
(Path::new(vec!("std", "hash", "Hash")),
39-
LifetimeBounds::empty(),
40-
Path::new(vec!("std", "hash", "sip", "SipState")))
28+
let path = Path::new_(vec!("std", "hash", "Hash"), None,
29+
vec!(box Literal(Path::new_local("__S"))), true);
30+
let generics = LifetimeBounds {
31+
lifetimes: Vec::new(),
32+
bounds: vec!(("__S",
33+
vec!(Path::new(vec!("std", "hash", "Writer"))))),
4134
};
35+
let args = Path::new_local("__S");
4236
let inline = cx.meta_word(span, InternedString::new("inline"));
4337
let attrs = vec!(cx.attribute(span, inline));
4438
let hash_trait_def = TraitDef {

src/libsyntax/ext/expand.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,6 @@ fn new_span(cx: &ExtCtxt, sp: Span) -> Span {
11611161

11621162
pub struct ExpansionConfig {
11631163
pub crate_name: String,
1164-
pub deriving_hash_type_parameter: bool,
11651164
pub enable_quotes: bool,
11661165
pub recursion_limit: uint,
11671166
}
@@ -1170,7 +1169,6 @@ impl ExpansionConfig {
11701169
pub fn default(crate_name: String) -> ExpansionConfig {
11711170
ExpansionConfig {
11721171
crate_name: crate_name,
1173-
deriving_hash_type_parameter: false,
11741172
enable_quotes: false,
11751173
recursion_limit: 64,
11761174
}

src/libsyntax/feature_gate.rs

Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use std::ascii::AsciiExt;
3636

3737
// if you change this list without updating src/doc/reference.md, @cmr will be sad
3838
static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
39-
("globs", Active),
39+
("globs", Accepted),
4040
("macro_rules", Active),
4141
("struct_variant", Accepted),
4242
("asm", Active),
@@ -54,7 +54,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
5454
("lang_items", Active),
5555

5656
("simd", Active),
57-
("default_type_params", Active),
57+
("default_type_params", Accepted),
5858
("quote", Active),
5959
("link_llvm_intrinsics", Active),
6060
("linkage", Active),
@@ -67,7 +67,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
6767
("import_shadowing", Active),
6868
("advanced_slice_patterns", Active),
6969
("tuple_indexing", Accepted),
70-
("associated_types", Active),
70+
("associated_types", Accepted),
7171
("visible_private_types", Active),
7272
("slicing_syntax", Active),
7373

@@ -112,7 +112,6 @@ enum Status {
112112
/// A set of features to be used by later passes.
113113
#[derive(Copy)]
114114
pub struct Features {
115-
pub default_type_params: bool,
116115
pub unboxed_closures: bool,
117116
pub rustc_diagnostic_macros: bool,
118117
pub import_shadowing: bool,
@@ -125,7 +124,6 @@ pub struct Features {
125124
impl Features {
126125
pub fn new() -> Features {
127126
Features {
128-
default_type_params: false,
129127
unboxed_closures: false,
130128
rustc_diagnostic_macros: false,
131129
import_shadowing: false,
@@ -232,13 +230,7 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
232230

233231
fn visit_view_item(&mut self, i: &ast::ViewItem) {
234232
match i.node {
235-
ast::ViewItemUse(ref path) => {
236-
if let ast::ViewPathGlob(..) = path.node {
237-
self.gate_feature("globs", path.span,
238-
"glob import statements are \
239-
experimental and possibly buggy");
240-
}
241-
}
233+
ast::ViewItemUse(..) => {}
242234
ast::ViewItemExternCrate(..) => {
243235
for attr in i.attrs.iter() {
244236
if attr.name().get() == "phase"{
@@ -313,18 +305,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
313305
many unsafe patterns and may be \
314306
removed in the future");
315307
}
316-
317-
for item in items.iter() {
318-
match *item {
319-
ast::MethodImplItem(_) => {}
320-
ast::TypeImplItem(ref typedef) => {
321-
self.gate_feature("associated_types",
322-
typedef.span,
323-
"associated types are \
324-
experimental")
325-
}
326-
}
327-
}
328308
}
329309

330310
_ => {}
@@ -333,17 +313,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
333313
visit::walk_item(self, i);
334314
}
335315

336-
fn visit_trait_item(&mut self, trait_item: &ast::TraitItem) {
337-
match *trait_item {
338-
ast::RequiredMethod(_) | ast::ProvidedMethod(_) => {}
339-
ast::TypeTraitItem(ref ti) => {
340-
self.gate_feature("associated_types",
341-
ti.ty_param.span,
342-
"associated types are experimental")
343-
}
344-
}
345-
}
346-
347316
fn visit_foreign_item(&mut self, i: &ast::ForeignItem) {
348317
if attr::contains_name(i.attrs[], "linkage") {
349318
self.gate_feature("linkage", i.span,
@@ -379,20 +348,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
379348
visit::walk_expr(self, e);
380349
}
381350

382-
fn visit_generics(&mut self, generics: &ast::Generics) {
383-
for type_parameter in generics.ty_params.iter() {
384-
match type_parameter.default {
385-
Some(ref ty) => {
386-
self.gate_feature("default_type_params", ty.span,
387-
"default type parameters are \
388-
experimental and possibly buggy");
389-
}
390-
None => {}
391-
}
392-
}
393-
visit::walk_generics(self, generics);
394-
}
395-
396351
fn visit_attribute(&mut self, attr: &ast::Attribute) {
397352
if attr::contains_name(slice::ref_slice(attr), "lang") {
398353
self.gate_feature("lang_items",
@@ -498,7 +453,6 @@ fn check_crate_inner<F>(cm: &CodeMap, span_handler: &SpanHandler, krate: &ast::C
498453
check(&mut cx, krate);
499454

500455
(Features {
501-
default_type_params: cx.has_feature("default_type_params"),
502456
unboxed_closures: cx.has_feature("unboxed_closures"),
503457
rustc_diagnostic_macros: cx.has_feature("rustc_diagnostic_macros"),
504458
import_shadowing: cx.has_feature("import_shadowing"),

src/test/auxiliary/associated-types-cc-lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// cross-crate scenario.
1313

1414
#![crate_type="lib"]
15-
#![feature(associated_types)]
1615

1716
pub trait Bar {
1817
type T;

src/test/auxiliary/default_type_params_xc.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(default_type_params)]
12-
1311
pub struct Heap;
1412

1513
pub struct FakeHeap;

src/test/auxiliary/issue-16643.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
#![crate_type = "lib"]
12-
#![feature(associated_types)]
1312

1413
pub struct TreeBuilder<H>;
1514

src/test/auxiliary/issue_20389.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(associated_types)]
12-
1311
pub trait T {
1412
type C;
1513
}

src/test/auxiliary/issue_2316_b.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
#![allow(unused_imports)]
12-
#![feature(globs)]
1312

1413
extern crate issue_2316_a;
1514

src/test/auxiliary/macro_crate_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// force-host
1212

13-
#![feature(globs, plugin_registrar, macro_rules, quote)]
13+
#![feature(plugin_registrar, macro_rules, quote)]
1414

1515
extern crate syntax;
1616
extern crate rustc;

src/test/auxiliary/namespaced_enum_emulate_flat.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
#![feature(globs)]
1110

1211
pub use Foo::*;
1312

@@ -34,5 +33,3 @@ pub mod nest {
3433
pub fn foo() {}
3534
}
3635
}
37-
38-

src/test/auxiliary/overloaded_autoderef_xc.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(associated_types)]
12-
1311
use std::ops::Deref;
1412

1513
struct DerefWithHelper<H, T> {

src/test/auxiliary/syntax-extension-with-dll-deps-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// force-host
1212

1313
#![crate_type = "dylib"]
14-
#![feature(plugin_registrar, quote, globs)]
14+
#![feature(plugin_registrar, quote)]
1515

1616
extern crate "syntax-extension-with-dll-deps-1" as other;
1717
extern crate syntax;

src/test/auxiliary/trait_inheritance_overloading_xc.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(associated_types)]
12-
1311
use std::cmp::PartialEq;
1412
use std::ops::{Add, Sub, Mul};
1513

src/test/bench/shootout-fasta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
3939
// OF THE POSSIBILITY OF SUCH DAMAGE.
4040

41-
#![feature(associated_types, slicing_syntax)]
41+
#![feature(slicing_syntax)]
4242

4343
use std::cmp::min;
4444
use std::io::{BufferedWriter, File};

src/test/bench/shootout-k-nucleotide.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
// ignore-android see #10393 #13206
4242

43-
#![feature(associated_types, slicing_syntax)]
43+
#![feature(slicing_syntax)]
4444

4545
use std::ascii::OwnedAsciiExt;
4646
use std::iter::repeat;

src/test/bench/shootout-meteor.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040

4141
// no-pretty-expanded FIXME #15189
4242

43-
#![feature(associated_types)]
44-
4543
use std::iter::repeat;
4644
use std::sync::Arc;
4745
use std::sync::mpsc::channel;

src/test/bench/shootout-reverse-complement.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
// ignore-android see #10393 #13206
4242

43-
#![feature(associated_types, slicing_syntax, unboxed_closures)]
43+
#![feature(slicing_syntax, unboxed_closures)]
4444

4545
extern crate libc;
4646

src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// just propagate the error.
1313

1414
#![crate_type = "lib"]
15-
#![feature(associated_types, default_type_params, lang_items)]
15+
#![feature(lang_items)]
1616
#![no_std]
1717

1818
#[lang="sized"]

src/test/compile-fail/associated-types-bound-failure.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// Test equality constraints on associated types in a where clause.
1212

13-
#![feature(associated_types)]
14-
1513
pub trait ToInt {
1614
fn to_int(&self) -> int;
1715
}

src/test/compile-fail/associated-types-eq-1.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// Test equality constraints on associated types. Check that unsupported syntax
1212
// does not ICE.
1313

14-
#![feature(associated_types)]
15-
1614
pub trait Foo {
1715
type A;
1816
fn boo(&self) -> <Self as Foo>::A;

src/test/compile-fail/associated-types-eq-2.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// Test equality constraints on associated types. Check we get an error when an
1212
// equality constraint is used in a qualified path.
1313

14-
#![feature(associated_types)]
15-
1614
pub trait Foo {
1715
type A;
1816
fn boo(&self) -> <Self as Foo>::A;

src/test/compile-fail/associated-types-eq-3.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// Test equality constraints on associated types. Check we get type errors
1212
// where we should.
1313

14-
#![feature(associated_types)]
15-
1614
pub trait Foo {
1715
type A;
1816
fn boo(&self) -> <Self as Foo>::A;

src/test/compile-fail/associated-types-eq-expr-path.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// Check that an associated type cannot be bound in an expression path.
1212

13-
#![feature(associated_types)]
14-
1513
trait Foo {
1614
type A;
1715
fn bar() -> int;

src/test/compile-fail/associated-types-eq-hr.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// Check testing of equality constraints in a higher-ranked context.
1212

13-
#![feature(associated_types)]
14-
1513
pub trait TheTrait<T> {
1614
type A;
1715

0 commit comments

Comments
 (0)