Skip to content

Commit 74b2d69

Browse files
committed
remove associated_consts feature gate
1 parent ccf401f commit 74b2d69

File tree

87 files changed

+64
-266
lines changed

Some content is hidden

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

87 files changed

+64
-266
lines changed

src/doc/unstable-book/src/language-features/associated-consts.md

-85
This file was deleted.

src/libcore/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
#![feature(allow_internal_unstable)]
7171
#![feature(asm)]
7272
#![feature(associated_type_defaults)]
73-
#![feature(associated_consts)]
7473
#![feature(cfg_target_feature)]
7574
#![feature(cfg_target_has_atomic)]
7675
#![feature(concat_idents)]
@@ -94,6 +93,8 @@
9493
#![feature(untagged_unions)]
9594
#![feature(unwind_attributes)]
9695

96+
#![cfg_attr(stage0, feature(associated_consts))]
97+
9798
#[prelude_import]
9899
#[allow(unused)]
99100
use prelude::v1::*;

src/librustc/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
html_root_url = "https://doc.rust-lang.org/nightly/")]
2323
#![deny(warnings)]
2424

25-
#![feature(associated_consts)]
2625
#![feature(box_patterns)]
2726
#![feature(box_syntax)]
2827
#![feature(conservative_impl_trait)]
@@ -42,6 +41,8 @@
4241
#![feature(trace_macros)]
4342
#![feature(test)]
4443

44+
#![cfg_attr(stage0, feature(associated_consts))]
45+
4546
#![recursion_limit="256"]
4647

4748
extern crate arena;

src/librustc_bitflags/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010

1111

1212
#![crate_name = "rustc_bitflags"]
13-
#![feature(associated_consts)]
1413
#![crate_type = "rlib"]
1514
#![no_std]
1615
#![deny(warnings)]
1716

17+
#![cfg_attr(stage0, feature(associated_consts))]
18+
1819
//! A typesafe bitmask flag generator.
1920
2021
#[cfg(test)]
@@ -31,7 +32,6 @@ extern crate std;
3132
///
3233
/// ```{.rust}
3334
/// #![feature(rustc_private)]
34-
/// #![feature(associated_consts)]
3535
/// #[macro_use] extern crate rustc_bitflags;
3636
///
3737
/// bitflags! {

src/librustc_borrowck/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020

2121
#![feature(quote)]
2222
#![feature(rustc_diagnostic_macros)]
23-
#![feature(associated_consts)]
23+
24+
#![cfg_attr(stage0, feature(associated_consts))]
2425

2526
#[macro_use] extern crate log;
2627
#[macro_use] extern crate syntax;

src/librustc_data_structures/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
#![feature(nonzero)]
3030
#![feature(unboxed_closures)]
3131
#![feature(fn_traits)]
32-
#![feature(associated_consts)]
3332
#![feature(unsize)]
3433
#![feature(i128_type)]
3534
#![feature(conservative_impl_trait)]
3635
#![feature(discriminant_value)]
3736
#![feature(specialization)]
3837
#![feature(manually_drop)]
3938

39+
#![cfg_attr(stage0, feature(associated_consts))]
4040
#![cfg_attr(stage0, feature(struct_field_attributes))]
4141

4242
#![cfg_attr(unix, feature(libc))]

src/librustc_llvm/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@
2121
html_root_url = "https://doc.rust-lang.org/nightly/")]
2222
#![deny(warnings)]
2323

24-
#![feature(associated_consts)]
2524
#![feature(box_syntax)]
2625
#![feature(concat_idents)]
2726
#![feature(libc)]
2827
#![feature(link_args)]
2928
#![feature(static_nobundle)]
3029

30+
#![cfg_attr(stage0, feature(associated_consts))]
31+
3132
extern crate libc;
3233
#[macro_use]
3334
#[no_link]

src/librustc_mir/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
1919
#![crate_type = "dylib"]
2020
#![deny(warnings)]
2121

22-
#![feature(associated_consts)]
2322
#![feature(box_patterns)]
2423
#![feature(box_syntax)]
2524
#![feature(i128_type)]
@@ -28,6 +27,8 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
2827
#![feature(collection_placement)]
2928
#![feature(nonzero)]
3029

30+
#![cfg_attr(stage0, feature(associated_consts))]
31+
3132
#[macro_use] extern crate log;
3233
extern crate graphviz as dot;
3334
#[macro_use]

src/librustc_resolve/diagnostics.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1320,8 +1320,6 @@ match the name of any associated constant in the trait.
13201320
Erroneous code example:
13211321
13221322
```compile_fail,E0438
1323-
#![feature(associated_consts)]
1324-
13251323
trait Foo {}
13261324
13271325
impl Foo for i32 {

src/librustc_resolve/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
html_root_url = "https://doc.rust-lang.org/nightly/")]
1717
#![deny(warnings)]
1818

19-
#![feature(associated_consts)]
2019
#![feature(rustc_diagnostic_macros)]
2120

21+
#![cfg_attr(stage0, feature(associated_consts))]
22+
2223
#[macro_use]
2324
extern crate log;
2425
#[macro_use]

src/librustc_trans/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
html_root_url = "https://doc.rust-lang.org/nightly/")]
2323
#![deny(warnings)]
2424

25-
#![feature(associated_consts)]
2625
#![feature(box_patterns)]
2726
#![feature(box_syntax)]
2827
#![feature(const_fn)]
@@ -35,6 +34,8 @@
3534
#![feature(slice_patterns)]
3635
#![feature(conservative_impl_trait)]
3736

37+
#![cfg_attr(stage0, feature(associated_consts))]
38+
3839
use rustc::dep_graph::WorkProduct;
3940
use syntax_pos::symbol::Symbol;
4041

src/librustc_typeck/diagnostics.rs

-18
Original file line numberDiff line numberDiff line change
@@ -2777,8 +2777,6 @@ An associated const was implemented when another trait item was expected.
27772777
Erroneous code example:
27782778
27792779
```compile_fail,E0323
2780-
#![feature(associated_consts)]
2781-
27822780
trait Foo {
27832781
type N;
27842782
}
@@ -2810,8 +2808,6 @@ impl Foo for Bar {
28102808
Or:
28112809
28122810
```
2813-
#![feature(associated_consts)]
2814-
28152811
struct Bar;
28162812
28172813
trait Foo {
@@ -2829,8 +2825,6 @@ A method was implemented when another trait item was expected. Erroneous
28292825
code example:
28302826
28312827
```compile_fail,E0324
2832-
#![feature(associated_consts)]
2833-
28342828
struct Bar;
28352829
28362830
trait Foo {
@@ -2850,8 +2844,6 @@ To fix this error, please verify that the method name wasn't misspelled and
28502844
verify that you are indeed implementing the correct trait items. Example:
28512845
28522846
```
2853-
#![feature(associated_consts)]
2854-
28552847
struct Bar;
28562848
28572849
trait Foo {
@@ -2873,8 +2865,6 @@ An associated type was implemented when another trait item was expected.
28732865
Erroneous code example:
28742866
28752867
```compile_fail,E0325
2876-
#![feature(associated_consts)]
2877-
28782868
struct Bar;
28792869
28802870
trait Foo {
@@ -2906,8 +2896,6 @@ impl Foo for Bar {
29062896
Or:
29072897
29082898
```
2909-
#![feature(associated_consts)]
2910-
29112899
struct Bar;
29122900
29132901
trait Foo {
@@ -2927,8 +2915,6 @@ types in the trait definition. This error indicates that there was a mismatch.
29272915
Here's an example of this error:
29282916
29292917
```compile_fail,E0326
2930-
#![feature(associated_consts)]
2931-
29322918
trait Foo {
29332919
const BAR: bool;
29342920
}
@@ -2991,8 +2977,6 @@ type parameter or `Self`. This is not supported yet. An example causing this
29912977
error is shown below:
29922978
29932979
```
2994-
#![feature(associated_consts)]
2995-
29962980
trait Foo {
29972981
const BAR: f64;
29982982
}
@@ -3012,8 +2996,6 @@ Currently, the value of `BAR` for a particular type can only be accessed
30122996
through a concrete type, as shown below:
30132997
30142998
```
3015-
#![feature(associated_consts)]
3016-
30172999
trait Foo {
30183000
const BAR: f64;
30193001
}

src/libstd/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@
245245
#![feature(allocator_internals)]
246246
#![feature(allow_internal_unstable)]
247247
#![feature(asm)]
248-
#![feature(associated_consts)]
249248
#![feature(box_syntax)]
250249
#![feature(cfg_target_has_atomic)]
251250
#![feature(cfg_target_thread_local)]
@@ -320,6 +319,7 @@
320319
#![cfg_attr(test, feature(float_bits_conv))]
321320

322321
#![cfg_attr(not(stage0), default_lib_allocator)]
322+
#![cfg_attr(stage0, feature(associated_consts))]
323323

324324
// Explicitly import the prelude. The compiler uses this same unstable attribute
325325
// to import the prelude implicitly when building crates that depend on std.

src/libsyntax/feature_gate.rs

+3-14
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,6 @@ declare_features! (
198198
// #23121. Array patterns have some hazards yet.
199199
(active, slice_patterns, "1.0.0", Some(23121)),
200200

201-
// Allows the definition of associated constants in `trait` or `impl`
202-
// blocks.
203-
(active, associated_consts, "1.0.0", Some(29646)),
204-
205201
// Allows the definition of `const fn` functions.
206202
(active, const_fn, "1.2.0", Some(24111)),
207203

@@ -446,6 +442,9 @@ declare_features! (
446442
(accepted, closure_to_fn_coercion, "1.19.0", Some(39817)),
447443
// Allows attributes on struct literal fields.
448444
(accepted, struct_field_attributes, "1.20.0", Some(38814)),
445+
// Allows the definition of associated constants in `trait` or `impl`
446+
// blocks.
447+
(accepted, associated_consts, "1.20.0", Some(29646)),
449448
);
450449

451450
// If you change this, please modify src/doc/unstable-book as well. You must
@@ -1405,11 +1404,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
14051404

14061405
fn visit_trait_item(&mut self, ti: &'a ast::TraitItem) {
14071406
match ti.node {
1408-
ast::TraitItemKind::Const(..) => {
1409-
gate_feature_post!(&self, associated_consts,
1410-
ti.span,
1411-
"associated constants are experimental")
1412-
}
14131407
ast::TraitItemKind::Method(ref sig, ref block) => {
14141408
if block.is_none() {
14151409
self.check_abi(sig.abi, ti.span);
@@ -1435,11 +1429,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
14351429
}
14361430

14371431
match ii.node {
1438-
ast::ImplItemKind::Const(..) => {
1439-
gate_feature_post!(&self, associated_consts,
1440-
ii.span,
1441-
"associated constants are experimental")
1442-
}
14431432
ast::ImplItemKind::Method(ref sig, _) => {
14441433
if sig.constness.node == ast::Constness::Const {
14451434
gate_feature_post!(&self, const_fn, ii.span, "const fn is unstable");

src/test/compile-fail-fulldeps/auxiliary/use_from_trait_xc.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(associated_consts)]
1211

1312
pub use self::sub::{Bar, Baz};
1413

src/test/compile-fail/E0164.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(associated_consts)]
1211

1312
enum Foo {}
1413

0 commit comments

Comments
 (0)