From 74b2d693589add69cf03588ae0eb336c1be7d52b Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Thu, 6 Jul 2017 11:52:25 -0700 Subject: [PATCH] remove associated_consts feature gate --- .../language-features/associated-consts.md | 85 ------------------- src/libcore/lib.rs | 3 +- src/librustc/lib.rs | 3 +- src/librustc_bitflags/lib.rs | 4 +- src/librustc_borrowck/lib.rs | 3 +- src/librustc_data_structures/lib.rs | 2 +- src/librustc_llvm/lib.rs | 3 +- src/librustc_mir/lib.rs | 3 +- src/librustc_resolve/diagnostics.rs | 2 - src/librustc_resolve/lib.rs | 3 +- src/librustc_trans/lib.rs | 3 +- src/librustc_typeck/diagnostics.rs | 18 ---- src/libstd/lib.rs | 2 +- src/libsyntax/feature_gate.rs | 17 +--- .../auxiliary/use_from_trait_xc.rs | 1 - src/test/compile-fail/E0164.rs | 1 - src/test/compile-fail/E0438.rs | 1 - .../associated-const-ambiguity-report.rs | 1 - .../associated-const-array-len.rs | 1 - .../associated-const-dead-code.rs | 1 - .../associated-const-generic-obligations.rs | 1 - .../associated-const-impl-wrong-lifetime.rs | 1 - .../associated-const-impl-wrong-type.rs | 1 - .../compile-fail/associated-const-no-item.rs | 1 - .../associated-const-private-impl.rs | 1 - .../associated-const-type-parameter-arms.rs | 1 - ...ssociated-const-type-parameter-arrays-2.rs | 1 - .../associated-const-type-parameter-arrays.rs | 1 - .../associated-const-upper-case-lint.rs | 1 - .../associated-item-duplicate-names-2.rs | 1 - .../associated-item-duplicate-names.rs | 1 - .../associated-types-overridden-default.rs | 1 - .../compile-fail/auxiliary/issue_41549.rs | 1 - .../auxiliary/use_from_trait_xc.rs | 1 - .../compile-fail/gated-associated_consts.rs | 23 ----- src/test/compile-fail/issue-28992-empty.rs | 1 - src/test/compile-fail/issue-31910.rs | 1 - src/test/compile-fail/issue-41549.rs | 1 - .../object-safety-associated-consts.rs | 1 - src/test/compile-fail/privacy-sanity.rs | 1 - .../compile-fail/private-in-public-warn.rs | 1 - src/test/compile-fail/private-in-public.rs | 1 - .../stmt_expr_attrs_no_feature.rs | 1 - ...rait-impl-can-not-have-untraitful-items.rs | 1 - src/test/compile-fail/trait-item-privacy.rs | 1 - src/test/compile-fail/use-from-trait.rs | 1 - src/test/incremental/hashes/trait_defs.rs | 1 - .../run-pass/associated-const-const-eval.rs | 1 - ...associated-const-cross-crate-const-eval.rs | 1 - .../associated-const-cross-crate-defaults.rs | 1 - .../run-pass/associated-const-cross-crate.rs | 1 - .../associated-const-in-global-const.rs | 1 - .../associated-const-inherent-impl.rs | 1 - .../associated-const-marks-live-code.rs | 1 - .../associated-const-match-patterns.rs | 1 - .../associated-const-outer-ty-refs.rs | 1 - .../associated-const-overwrite-default.rs | 1 - .../run-pass/associated-const-public-impl.rs | 1 - .../associated-const-range-match-patterns.rs | 1 - .../associated-const-resolution-order.rs | 1 - .../run-pass/associated-const-self-type.rs | 1 - .../associated-const-type-parameters.rs | 1 - .../associated-const-ufcs-infer-trait.rs | 1 - .../run-pass/associated-const-use-default.rs | 1 - ...associated-const-use-impl-of-same-trait.rs | 1 - src/test/run-pass/associated-const.rs | 1 - .../auxiliary/associated-const-cc-lib.rs | 1 - src/test/run-pass/issue-23808.rs | 1 - src/test/run-pass/issue-24947.rs | 1 - src/test/run-pass/issue-25145.rs | 1 - src/test/run-pass/issue-26095.rs | 1 - src/test/run-pass/issue-31267-additional.rs | 1 - src/test/run-pass/issue-31267.rs | 1 - src/test/run-pass/issue-40136.rs | 1 - src/test/rustdoc/assoc-consts.rs | 1 - src/test/rustdoc/auxiliary/issue-36031.rs | 1 - src/test/rustdoc/const-doc.rs | 1 - src/test/rustdoc/issue-28478.rs | 1 - src/test/rustdoc/issue-31808.rs | 2 - src/test/rustdoc/issue-33302.rs | 1 - src/test/ui/missing-items/auxiliary/m1.rs | 1 - src/test/ui/missing-items/m2.rs | 1 - src/test/ui/missing-items/m2.stderr | 6 +- src/test/ui/span/impl-wrong-item-for-trait.rs | 1 - .../ui/span/impl-wrong-item-for-trait.stderr | 76 ++++++++--------- src/test/ui/span/issue-29595.rs | 1 - src/test/ui/span/issue-29595.stderr | 4 +- 87 files changed, 64 insertions(+), 266 deletions(-) delete mode 100644 src/doc/unstable-book/src/language-features/associated-consts.md delete mode 100644 src/test/compile-fail/gated-associated_consts.rs diff --git a/src/doc/unstable-book/src/language-features/associated-consts.md b/src/doc/unstable-book/src/language-features/associated-consts.md deleted file mode 100644 index d661108e7d95e..0000000000000 --- a/src/doc/unstable-book/src/language-features/associated-consts.md +++ /dev/null @@ -1,85 +0,0 @@ -# `associated_consts` - -The tracking issue for this feature is: [#29646] - -[#29646]: https://github.com/rust-lang/rust/issues/29646 - ------------------------- - -With the `associated_consts` feature, you can define constants like this: - -```rust -#![feature(associated_consts)] - -trait Foo { - const ID: i32; -} - -impl Foo for i32 { - const ID: i32 = 1; -} - -fn main() { - assert_eq!(1, i32::ID); -} -``` - -Any implementor of `Foo` will have to define `ID`. Without the definition: - -```rust,ignore -#![feature(associated_consts)] - -trait Foo { - const ID: i32; -} - -impl Foo for i32 { -} -``` - -gives - -```text -error: not all trait items implemented, missing: `ID` [E0046] - impl Foo for i32 { - } -``` - -A default value can be implemented as well: - -```rust -#![feature(associated_consts)] - -trait Foo { - const ID: i32 = 1; -} - -impl Foo for i32 { -} - -impl Foo for i64 { - const ID: i32 = 5; -} - -fn main() { - assert_eq!(1, i32::ID); - assert_eq!(5, i64::ID); -} -``` - -As you can see, when implementing `Foo`, you can leave it unimplemented, as -with `i32`. It will then use the default value. But, as in `i64`, we can also -add our own definition. - -Associated constants don’t have to be associated with a trait. An `impl` block -for a `struct` or an `enum` works fine too: - -```rust -#![feature(associated_consts)] - -struct Foo; - -impl Foo { - const FOO: u32 = 3; -} -``` diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 97aaaffe8bc88..e8e31ffea0b98 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -70,7 +70,6 @@ #![feature(allow_internal_unstable)] #![feature(asm)] #![feature(associated_type_defaults)] -#![feature(associated_consts)] #![feature(cfg_target_feature)] #![feature(cfg_target_has_atomic)] #![feature(concat_idents)] @@ -94,6 +93,8 @@ #![feature(untagged_unions)] #![feature(unwind_attributes)] +#![cfg_attr(stage0, feature(associated_consts))] + #[prelude_import] #[allow(unused)] use prelude::v1::*; diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index efa6a6cccc2b6..e0317e5e7f8a7 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -22,7 +22,6 @@ html_root_url = "https://doc.rust-lang.org/nightly/")] #![deny(warnings)] -#![feature(associated_consts)] #![feature(box_patterns)] #![feature(box_syntax)] #![feature(conservative_impl_trait)] @@ -42,6 +41,8 @@ #![feature(trace_macros)] #![feature(test)] +#![cfg_attr(stage0, feature(associated_consts))] + #![recursion_limit="256"] extern crate arena; diff --git a/src/librustc_bitflags/lib.rs b/src/librustc_bitflags/lib.rs index 7576d9eeb3f75..83660714af78d 100644 --- a/src/librustc_bitflags/lib.rs +++ b/src/librustc_bitflags/lib.rs @@ -10,11 +10,12 @@ #![crate_name = "rustc_bitflags"] -#![feature(associated_consts)] #![crate_type = "rlib"] #![no_std] #![deny(warnings)] +#![cfg_attr(stage0, feature(associated_consts))] + //! A typesafe bitmask flag generator. #[cfg(test)] @@ -31,7 +32,6 @@ extern crate std; /// /// ```{.rust} /// #![feature(rustc_private)] -/// #![feature(associated_consts)] /// #[macro_use] extern crate rustc_bitflags; /// /// bitflags! { diff --git a/src/librustc_borrowck/lib.rs b/src/librustc_borrowck/lib.rs index a2b1e3c26637d..723df564419a4 100644 --- a/src/librustc_borrowck/lib.rs +++ b/src/librustc_borrowck/lib.rs @@ -20,7 +20,8 @@ #![feature(quote)] #![feature(rustc_diagnostic_macros)] -#![feature(associated_consts)] + +#![cfg_attr(stage0, feature(associated_consts))] #[macro_use] extern crate log; #[macro_use] extern crate syntax; diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs index d63b4c9c31b5b..5d856597cad53 100644 --- a/src/librustc_data_structures/lib.rs +++ b/src/librustc_data_structures/lib.rs @@ -29,7 +29,6 @@ #![feature(nonzero)] #![feature(unboxed_closures)] #![feature(fn_traits)] -#![feature(associated_consts)] #![feature(unsize)] #![feature(i128_type)] #![feature(conservative_impl_trait)] @@ -37,6 +36,7 @@ #![feature(specialization)] #![feature(manually_drop)] +#![cfg_attr(stage0, feature(associated_consts))] #![cfg_attr(stage0, feature(struct_field_attributes))] #![cfg_attr(unix, feature(libc))] diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index b5dfe9bb1678c..947e433fdb936 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -21,13 +21,14 @@ html_root_url = "https://doc.rust-lang.org/nightly/")] #![deny(warnings)] -#![feature(associated_consts)] #![feature(box_syntax)] #![feature(concat_idents)] #![feature(libc)] #![feature(link_args)] #![feature(static_nobundle)] +#![cfg_attr(stage0, feature(associated_consts))] + extern crate libc; #[macro_use] #[no_link] diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs index 71855d3805e13..bb1767773327c 100644 --- a/src/librustc_mir/lib.rs +++ b/src/librustc_mir/lib.rs @@ -19,7 +19,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment! #![crate_type = "dylib"] #![deny(warnings)] -#![feature(associated_consts)] #![feature(box_patterns)] #![feature(box_syntax)] #![feature(i128_type)] @@ -28,6 +27,8 @@ Rust MIR: a lowered representation of Rust. Also: an experiment! #![feature(collection_placement)] #![feature(nonzero)] +#![cfg_attr(stage0, feature(associated_consts))] + #[macro_use] extern crate log; extern crate graphviz as dot; #[macro_use] diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 34f3ff276ccd9..28b5b7c440cfd 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -1320,8 +1320,6 @@ match the name of any associated constant in the trait. Erroneous code example: ```compile_fail,E0438 -#![feature(associated_consts)] - trait Foo {} impl Foo for i32 { diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 4bfe4d25ded93..b60a8df407f7b 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -16,9 +16,10 @@ html_root_url = "https://doc.rust-lang.org/nightly/")] #![deny(warnings)] -#![feature(associated_consts)] #![feature(rustc_diagnostic_macros)] +#![cfg_attr(stage0, feature(associated_consts))] + #[macro_use] extern crate log; #[macro_use] diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 5c76f778f8d63..3038c7d6c782e 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -22,7 +22,6 @@ html_root_url = "https://doc.rust-lang.org/nightly/")] #![deny(warnings)] -#![feature(associated_consts)] #![feature(box_patterns)] #![feature(box_syntax)] #![feature(const_fn)] @@ -35,6 +34,8 @@ #![feature(slice_patterns)] #![feature(conservative_impl_trait)] +#![cfg_attr(stage0, feature(associated_consts))] + use rustc::dep_graph::WorkProduct; use syntax_pos::symbol::Symbol; diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 37f6f3753d7b4..368fada511b9f 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -2777,8 +2777,6 @@ An associated const was implemented when another trait item was expected. Erroneous code example: ```compile_fail,E0323 -#![feature(associated_consts)] - trait Foo { type N; } @@ -2810,8 +2808,6 @@ impl Foo for Bar { Or: ``` -#![feature(associated_consts)] - struct Bar; trait Foo { @@ -2829,8 +2825,6 @@ A method was implemented when another trait item was expected. Erroneous code example: ```compile_fail,E0324 -#![feature(associated_consts)] - struct Bar; trait Foo { @@ -2850,8 +2844,6 @@ To fix this error, please verify that the method name wasn't misspelled and verify that you are indeed implementing the correct trait items. Example: ``` -#![feature(associated_consts)] - struct Bar; trait Foo { @@ -2873,8 +2865,6 @@ An associated type was implemented when another trait item was expected. Erroneous code example: ```compile_fail,E0325 -#![feature(associated_consts)] - struct Bar; trait Foo { @@ -2906,8 +2896,6 @@ impl Foo for Bar { Or: ``` -#![feature(associated_consts)] - struct Bar; trait Foo { @@ -2927,8 +2915,6 @@ types in the trait definition. This error indicates that there was a mismatch. Here's an example of this error: ```compile_fail,E0326 -#![feature(associated_consts)] - trait Foo { const BAR: bool; } @@ -2991,8 +2977,6 @@ type parameter or `Self`. This is not supported yet. An example causing this error is shown below: ``` -#![feature(associated_consts)] - trait Foo { const BAR: f64; } @@ -3012,8 +2996,6 @@ Currently, the value of `BAR` for a particular type can only be accessed through a concrete type, as shown below: ``` -#![feature(associated_consts)] - trait Foo { const BAR: f64; } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index c4bdf7c5b822b..2fc107c663bb4 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -245,7 +245,6 @@ #![feature(allocator_internals)] #![feature(allow_internal_unstable)] #![feature(asm)] -#![feature(associated_consts)] #![feature(box_syntax)] #![feature(cfg_target_has_atomic)] #![feature(cfg_target_thread_local)] @@ -320,6 +319,7 @@ #![cfg_attr(test, feature(float_bits_conv))] #![cfg_attr(not(stage0), default_lib_allocator)] +#![cfg_attr(stage0, feature(associated_consts))] // Explicitly import the prelude. The compiler uses this same unstable attribute // to import the prelude implicitly when building crates that depend on std. diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index cb625b1ac066e..9adba7f50ccaf 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -198,10 +198,6 @@ declare_features! ( // #23121. Array patterns have some hazards yet. (active, slice_patterns, "1.0.0", Some(23121)), - // Allows the definition of associated constants in `trait` or `impl` - // blocks. - (active, associated_consts, "1.0.0", Some(29646)), - // Allows the definition of `const fn` functions. (active, const_fn, "1.2.0", Some(24111)), @@ -446,6 +442,9 @@ declare_features! ( (accepted, closure_to_fn_coercion, "1.19.0", Some(39817)), // Allows attributes on struct literal fields. (accepted, struct_field_attributes, "1.20.0", Some(38814)), + // Allows the definition of associated constants in `trait` or `impl` + // blocks. + (accepted, associated_consts, "1.20.0", Some(29646)), ); // 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> { fn visit_trait_item(&mut self, ti: &'a ast::TraitItem) { match ti.node { - ast::TraitItemKind::Const(..) => { - gate_feature_post!(&self, associated_consts, - ti.span, - "associated constants are experimental") - } ast::TraitItemKind::Method(ref sig, ref block) => { if block.is_none() { self.check_abi(sig.abi, ti.span); @@ -1435,11 +1429,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { } match ii.node { - ast::ImplItemKind::Const(..) => { - gate_feature_post!(&self, associated_consts, - ii.span, - "associated constants are experimental") - } ast::ImplItemKind::Method(ref sig, _) => { if sig.constness.node == ast::Constness::Const { gate_feature_post!(&self, const_fn, ii.span, "const fn is unstable"); diff --git a/src/test/compile-fail-fulldeps/auxiliary/use_from_trait_xc.rs b/src/test/compile-fail-fulldeps/auxiliary/use_from_trait_xc.rs index 7024c9dad7c11..9a6d176d0887b 100644 --- a/src/test/compile-fail-fulldeps/auxiliary/use_from_trait_xc.rs +++ b/src/test/compile-fail-fulldeps/auxiliary/use_from_trait_xc.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] pub use self::sub::{Bar, Baz}; diff --git a/src/test/compile-fail/E0164.rs b/src/test/compile-fail/E0164.rs index 8d21cde84da1c..cf6cf15115ac0 100644 --- a/src/test/compile-fail/E0164.rs +++ b/src/test/compile-fail/E0164.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] enum Foo {} diff --git a/src/test/compile-fail/E0438.rs b/src/test/compile-fail/E0438.rs index 2e2df4bee5a35..99e0dbbcea804 100644 --- a/src/test/compile-fail/E0438.rs +++ b/src/test/compile-fail/E0438.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait Bar {} diff --git a/src/test/compile-fail/associated-const-ambiguity-report.rs b/src/test/compile-fail/associated-const-ambiguity-report.rs index 22292a6da9dff..5051e78d1ba17 100644 --- a/src/test/compile-fail/associated-const-ambiguity-report.rs +++ b/src/test/compile-fail/associated-const-ambiguity-report.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait Foo { const ID: i32; diff --git a/src/test/compile-fail/associated-const-array-len.rs b/src/test/compile-fail/associated-const-array-len.rs index 7f77ae2ec1f10..2cc10f0f956b7 100644 --- a/src/test/compile-fail/associated-const-array-len.rs +++ b/src/test/compile-fail/associated-const-array-len.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait Foo { const ID: usize; diff --git a/src/test/compile-fail/associated-const-dead-code.rs b/src/test/compile-fail/associated-const-dead-code.rs index 1ed156d45f550..42db13f4f3bd4 100644 --- a/src/test/compile-fail/associated-const-dead-code.rs +++ b/src/test/compile-fail/associated-const-dead-code.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] #![deny(dead_code)] struct MyFoo; diff --git a/src/test/compile-fail/associated-const-generic-obligations.rs b/src/test/compile-fail/associated-const-generic-obligations.rs index 90afe8d7336a7..45f53418dca50 100644 --- a/src/test/compile-fail/associated-const-generic-obligations.rs +++ b/src/test/compile-fail/associated-const-generic-obligations.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait Foo { type Out: Sized; diff --git a/src/test/compile-fail/associated-const-impl-wrong-lifetime.rs b/src/test/compile-fail/associated-const-impl-wrong-lifetime.rs index 834f346069418..51681a4bb880b 100644 --- a/src/test/compile-fail/associated-const-impl-wrong-lifetime.rs +++ b/src/test/compile-fail/associated-const-impl-wrong-lifetime.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait Foo { const NAME: &'static str; diff --git a/src/test/compile-fail/associated-const-impl-wrong-type.rs b/src/test/compile-fail/associated-const-impl-wrong-type.rs index ec495c87b1a3f..e38851ccd6ff6 100644 --- a/src/test/compile-fail/associated-const-impl-wrong-type.rs +++ b/src/test/compile-fail/associated-const-impl-wrong-type.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait Foo { const BAR: u32; //~ NOTE type in trait diff --git a/src/test/compile-fail/associated-const-no-item.rs b/src/test/compile-fail/associated-const-no-item.rs index 89d1ac13087a9..f9a57cd6d75ef 100644 --- a/src/test/compile-fail/associated-const-no-item.rs +++ b/src/test/compile-fail/associated-const-no-item.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait Foo { const ID: i32; diff --git a/src/test/compile-fail/associated-const-private-impl.rs b/src/test/compile-fail/associated-const-private-impl.rs index 6ebe80b5701b9..b5accfff5bbf5 100644 --- a/src/test/compile-fail/associated-const-private-impl.rs +++ b/src/test/compile-fail/associated-const-private-impl.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] mod bar1 { pub use self::bar2::Foo; diff --git a/src/test/compile-fail/associated-const-type-parameter-arms.rs b/src/test/compile-fail/associated-const-type-parameter-arms.rs index f564157b49814..52bb4a1b463b4 100644 --- a/src/test/compile-fail/associated-const-type-parameter-arms.rs +++ b/src/test/compile-fail/associated-const-type-parameter-arms.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] pub enum EFoo { A, B, C, D } diff --git a/src/test/compile-fail/associated-const-type-parameter-arrays-2.rs b/src/test/compile-fail/associated-const-type-parameter-arrays-2.rs index e284a61eb2daa..d196cf2215601 100644 --- a/src/test/compile-fail/associated-const-type-parameter-arrays-2.rs +++ b/src/test/compile-fail/associated-const-type-parameter-arrays-2.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] pub trait Foo { const Y: usize; diff --git a/src/test/compile-fail/associated-const-type-parameter-arrays.rs b/src/test/compile-fail/associated-const-type-parameter-arrays.rs index 848ea65a9cfd1..0b24cab2a681c 100644 --- a/src/test/compile-fail/associated-const-type-parameter-arrays.rs +++ b/src/test/compile-fail/associated-const-type-parameter-arrays.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] pub trait Foo { const Y: usize; diff --git a/src/test/compile-fail/associated-const-upper-case-lint.rs b/src/test/compile-fail/associated-const-upper-case-lint.rs index 752691fa1c550..497ff426b2fae 100644 --- a/src/test/compile-fail/associated-const-upper-case-lint.rs +++ b/src/test/compile-fail/associated-const-upper-case-lint.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] #![deny(non_upper_case_globals)] #![allow(dead_code)] diff --git a/src/test/compile-fail/associated-item-duplicate-names-2.rs b/src/test/compile-fail/associated-item-duplicate-names-2.rs index ab903591fbb06..85ea949b9c8da 100644 --- a/src/test/compile-fail/associated-item-duplicate-names-2.rs +++ b/src/test/compile-fail/associated-item-duplicate-names-2.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] struct Foo; diff --git a/src/test/compile-fail/associated-item-duplicate-names.rs b/src/test/compile-fail/associated-item-duplicate-names.rs index 85868f5c02085..a2fc1bc017767 100644 --- a/src/test/compile-fail/associated-item-duplicate-names.rs +++ b/src/test/compile-fail/associated-item-duplicate-names.rs @@ -10,7 +10,6 @@ // Test for issue #23969 -#![feature(associated_consts)] trait Foo { type Ty; diff --git a/src/test/compile-fail/associated-types-overridden-default.rs b/src/test/compile-fail/associated-types-overridden-default.rs index 19f13f5fc2f2b..946a4b2f73ac4 100644 --- a/src/test/compile-fail/associated-types-overridden-default.rs +++ b/src/test/compile-fail/associated-types-overridden-default.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] #![feature(associated_type_defaults)] pub trait Tr { diff --git a/src/test/compile-fail/auxiliary/issue_41549.rs b/src/test/compile-fail/auxiliary/issue_41549.rs index 77b203997b42a..5a6db78928273 100644 --- a/src/test/compile-fail/auxiliary/issue_41549.rs +++ b/src/test/compile-fail/auxiliary/issue_41549.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] pub trait Trait { const CONST: u32; diff --git a/src/test/compile-fail/auxiliary/use_from_trait_xc.rs b/src/test/compile-fail/auxiliary/use_from_trait_xc.rs index 7024c9dad7c11..9a6d176d0887b 100644 --- a/src/test/compile-fail/auxiliary/use_from_trait_xc.rs +++ b/src/test/compile-fail/auxiliary/use_from_trait_xc.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] pub use self::sub::{Bar, Baz}; diff --git a/src/test/compile-fail/gated-associated_consts.rs b/src/test/compile-fail/gated-associated_consts.rs deleted file mode 100644 index ee4422faf3a24..0000000000000 --- a/src/test/compile-fail/gated-associated_consts.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// gate-test-associated_consts - -trait MyTrait { - const C: bool; - //~^ associated constants are experimental -} - -struct Foo; - -impl Foo { - const C: bool = true; - //~^ associated constants are experimental -} diff --git a/src/test/compile-fail/issue-28992-empty.rs b/src/test/compile-fail/issue-28992-empty.rs index 48aabce708eab..536784508b77b 100644 --- a/src/test/compile-fail/issue-28992-empty.rs +++ b/src/test/compile-fail/issue-28992-empty.rs @@ -10,7 +10,6 @@ // Can't use constants as tuple struct patterns -#![feature(associated_consts)] const C1: i32 = 0; diff --git a/src/test/compile-fail/issue-31910.rs b/src/test/compile-fail/issue-31910.rs index aac8b89e882b3..7524049c5df3d 100644 --- a/src/test/compile-fail/issue-31910.rs +++ b/src/test/compile-fail/issue-31910.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] enum Enum { X = Trait::Number, diff --git a/src/test/compile-fail/issue-41549.rs b/src/test/compile-fail/issue-41549.rs index c4aab4bcabf63..67be194c8ed2a 100644 --- a/src/test/compile-fail/issue-41549.rs +++ b/src/test/compile-fail/issue-41549.rs @@ -10,7 +10,6 @@ // aux-build:issue_41549.rs -#![feature(associated_consts)] extern crate issue_41549; diff --git a/src/test/compile-fail/object-safety-associated-consts.rs b/src/test/compile-fail/object-safety-associated-consts.rs index c442cd4083657..ebb52face06ac 100644 --- a/src/test/compile-fail/object-safety-associated-consts.rs +++ b/src/test/compile-fail/object-safety-associated-consts.rs @@ -11,7 +11,6 @@ // Check that we correctly prevent users from making trait objects // from traits with associated consts. -#![feature(associated_consts)] trait Bar { const X: usize; diff --git a/src/test/compile-fail/privacy-sanity.rs b/src/test/compile-fail/privacy-sanity.rs index 063848f62aa9e..933ec3837dfc7 100644 --- a/src/test/compile-fail/privacy-sanity.rs +++ b/src/test/compile-fail/privacy-sanity.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] #![feature(optin_builtin_traits)] trait MarkerTr {} diff --git a/src/test/compile-fail/private-in-public-warn.rs b/src/test/compile-fail/private-in-public-warn.rs index 92d96595fd780..f030012b172f0 100644 --- a/src/test/compile-fail/private-in-public-warn.rs +++ b/src/test/compile-fail/private-in-public-warn.rs @@ -11,7 +11,6 @@ // Private types and traits are not allowed in public interfaces. // This test also ensures that the checks are performed even inside private modules. -#![feature(associated_consts)] #![feature(associated_type_defaults)] #![deny(private_in_public)] #![allow(unused)] diff --git a/src/test/compile-fail/private-in-public.rs b/src/test/compile-fail/private-in-public.rs index b819ef116efe9..b865e391d29c1 100644 --- a/src/test/compile-fail/private-in-public.rs +++ b/src/test/compile-fail/private-in-public.rs @@ -11,7 +11,6 @@ // Private types and traits are not allowed in public interfaces. // This test also ensures that the checks are performed even inside private modules. -#![feature(associated_consts)] #![feature(associated_type_defaults)] mod types { diff --git a/src/test/compile-fail/stmt_expr_attrs_no_feature.rs b/src/test/compile-fail/stmt_expr_attrs_no_feature.rs index 2fda2ee0900c7..d8626dfd39ee8 100644 --- a/src/test/compile-fail/stmt_expr_attrs_no_feature.rs +++ b/src/test/compile-fail/stmt_expr_attrs_no_feature.rs @@ -9,7 +9,6 @@ // except according to those terms. #![feature(custom_attribute)] -#![feature(associated_consts)] macro_rules! stmt_mac { () => { diff --git a/src/test/compile-fail/trait-impl-can-not-have-untraitful-items.rs b/src/test/compile-fail/trait-impl-can-not-have-untraitful-items.rs index 0ed4e62778e8b..cc143a6209d41 100644 --- a/src/test/compile-fail/trait-impl-can-not-have-untraitful-items.rs +++ b/src/test/compile-fail/trait-impl-can-not-have-untraitful-items.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait A { } diff --git a/src/test/compile-fail/trait-item-privacy.rs b/src/test/compile-fail/trait-item-privacy.rs index e915ca05f6751..b8d83e5adf23d 100644 --- a/src/test/compile-fail/trait-item-privacy.rs +++ b/src/test/compile-fail/trait-item-privacy.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] #![feature(associated_type_defaults)] struct S; diff --git a/src/test/compile-fail/use-from-trait.rs b/src/test/compile-fail/use-from-trait.rs index 58e37bbfa3ea7..33adc2b5bfe5a 100644 --- a/src/test/compile-fail/use-from-trait.rs +++ b/src/test/compile-fail/use-from-trait.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] use Trait::foo; //~^ ERROR `foo` is not directly importable diff --git a/src/test/incremental/hashes/trait_defs.rs b/src/test/incremental/hashes/trait_defs.rs index 61a2be054a51a..e47556a790b62 100644 --- a/src/test/incremental/hashes/trait_defs.rs +++ b/src/test/incremental/hashes/trait_defs.rs @@ -30,7 +30,6 @@ #![crate_type="rlib"] #![feature(associated_type_defaults)] #![feature(intrinsics)] -#![feature(associated_consts)] // Change trait visibility -------------------------------------------------------- diff --git a/src/test/run-pass/associated-const-const-eval.rs b/src/test/run-pass/associated-const-const-eval.rs index 0b230df41469f..9c36a42527f12 100644 --- a/src/test/run-pass/associated-const-const-eval.rs +++ b/src/test/run-pass/associated-const-const-eval.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait Foo { const NUM: usize; diff --git a/src/test/run-pass/associated-const-cross-crate-const-eval.rs b/src/test/run-pass/associated-const-cross-crate-const-eval.rs index 7d31bb5b1a5e2..c2758b1aed77f 100644 --- a/src/test/run-pass/associated-const-cross-crate-const-eval.rs +++ b/src/test/run-pass/associated-const-cross-crate-const-eval.rs @@ -10,7 +10,6 @@ // aux-build:associated-const-cc-lib.rs -#![feature(associated_consts)] extern crate associated_const_cc_lib as foolib; diff --git a/src/test/run-pass/associated-const-cross-crate-defaults.rs b/src/test/run-pass/associated-const-cross-crate-defaults.rs index 92d2aae61c8e5..084c448ba2ab1 100644 --- a/src/test/run-pass/associated-const-cross-crate-defaults.rs +++ b/src/test/run-pass/associated-const-cross-crate-defaults.rs @@ -10,7 +10,6 @@ // aux-build:associated-const-cc-lib.rs -#![feature(associated_consts)] extern crate associated_const_cc_lib as foolib; diff --git a/src/test/run-pass/associated-const-cross-crate.rs b/src/test/run-pass/associated-const-cross-crate.rs index 73d5dc5df96f6..a882d6ae23d8a 100644 --- a/src/test/run-pass/associated-const-cross-crate.rs +++ b/src/test/run-pass/associated-const-cross-crate.rs @@ -10,7 +10,6 @@ // aux-build:associated-const-cc-lib.rs -#![feature(associated_consts)] extern crate associated_const_cc_lib as foolib; diff --git a/src/test/run-pass/associated-const-in-global-const.rs b/src/test/run-pass/associated-const-in-global-const.rs index e3a1e29d20f54..b7fb4d73259b3 100644 --- a/src/test/run-pass/associated-const-in-global-const.rs +++ b/src/test/run-pass/associated-const-in-global-const.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] struct Foo; diff --git a/src/test/run-pass/associated-const-inherent-impl.rs b/src/test/run-pass/associated-const-inherent-impl.rs index 5c9abf982b158..86454a4a09117 100644 --- a/src/test/run-pass/associated-const-inherent-impl.rs +++ b/src/test/run-pass/associated-const-inherent-impl.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] struct Foo; diff --git a/src/test/run-pass/associated-const-marks-live-code.rs b/src/test/run-pass/associated-const-marks-live-code.rs index ea91a95312983..bfeb78ddfe5c7 100644 --- a/src/test/run-pass/associated-const-marks-live-code.rs +++ b/src/test/run-pass/associated-const-marks-live-code.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] #![deny(dead_code)] diff --git a/src/test/run-pass/associated-const-match-patterns.rs b/src/test/run-pass/associated-const-match-patterns.rs index 01d1b27bfc99f..54603e6e0d9aa 100644 --- a/src/test/run-pass/associated-const-match-patterns.rs +++ b/src/test/run-pass/associated-const-match-patterns.rs @@ -10,7 +10,6 @@ // aux-build:empty-struct.rs -#![feature(associated_consts)] extern crate empty_struct; use empty_struct::XEmpty2 as XFoo; diff --git a/src/test/run-pass/associated-const-outer-ty-refs.rs b/src/test/run-pass/associated-const-outer-ty-refs.rs index 2e6fb11a12d6b..987c64dbff562 100644 --- a/src/test/run-pass/associated-const-outer-ty-refs.rs +++ b/src/test/run-pass/associated-const-outer-ty-refs.rs @@ -7,7 +7,6 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait Lattice { const BOTTOM: Self; diff --git a/src/test/run-pass/associated-const-overwrite-default.rs b/src/test/run-pass/associated-const-overwrite-default.rs index 0846ad9a571b3..bb594cfa0f973 100644 --- a/src/test/run-pass/associated-const-overwrite-default.rs +++ b/src/test/run-pass/associated-const-overwrite-default.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait Foo { const ID: i32 = 2; diff --git a/src/test/run-pass/associated-const-public-impl.rs b/src/test/run-pass/associated-const-public-impl.rs index b1d071799e1a8..5ff363844a124 100644 --- a/src/test/run-pass/associated-const-public-impl.rs +++ b/src/test/run-pass/associated-const-public-impl.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] mod bar1 { pub use self::bar2::Foo; diff --git a/src/test/run-pass/associated-const-range-match-patterns.rs b/src/test/run-pass/associated-const-range-match-patterns.rs index d38ccca689141..d72e1efc4d74c 100644 --- a/src/test/run-pass/associated-const-range-match-patterns.rs +++ b/src/test/run-pass/associated-const-range-match-patterns.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] struct Foo; diff --git a/src/test/run-pass/associated-const-resolution-order.rs b/src/test/run-pass/associated-const-resolution-order.rs index 98b7164ab74ad..5fa49b48200db 100644 --- a/src/test/run-pass/associated-const-resolution-order.rs +++ b/src/test/run-pass/associated-const-resolution-order.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] struct MyType; diff --git a/src/test/run-pass/associated-const-self-type.rs b/src/test/run-pass/associated-const-self-type.rs index d3add976b5af8..16ccb5b39552c 100644 --- a/src/test/run-pass/associated-const-self-type.rs +++ b/src/test/run-pass/associated-const-self-type.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait MyInt { const ONE: Self; diff --git a/src/test/run-pass/associated-const-type-parameters.rs b/src/test/run-pass/associated-const-type-parameters.rs index df2083530646e..7859a87e014b0 100644 --- a/src/test/run-pass/associated-const-type-parameters.rs +++ b/src/test/run-pass/associated-const-type-parameters.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait Foo { const X: i32; diff --git a/src/test/run-pass/associated-const-ufcs-infer-trait.rs b/src/test/run-pass/associated-const-ufcs-infer-trait.rs index aa3e14a939784..b22630678249f 100644 --- a/src/test/run-pass/associated-const-ufcs-infer-trait.rs +++ b/src/test/run-pass/associated-const-ufcs-infer-trait.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait Foo { const ID: i32; diff --git a/src/test/run-pass/associated-const-use-default.rs b/src/test/run-pass/associated-const-use-default.rs index 5813d86742532..5ed9a6dea3dd7 100644 --- a/src/test/run-pass/associated-const-use-default.rs +++ b/src/test/run-pass/associated-const-use-default.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait Foo { const ID: i32 = 1; diff --git a/src/test/run-pass/associated-const-use-impl-of-same-trait.rs b/src/test/run-pass/associated-const-use-impl-of-same-trait.rs index 62658470baa52..986f160f3cbd0 100644 --- a/src/test/run-pass/associated-const-use-impl-of-same-trait.rs +++ b/src/test/run-pass/associated-const-use-impl-of-same-trait.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] // The main purpose of this test is to ensure that different impls of the same // trait can refer to each other without setting off the static recursion check diff --git a/src/test/run-pass/associated-const.rs b/src/test/run-pass/associated-const.rs index d906544500931..3c84f4a833530 100644 --- a/src/test/run-pass/associated-const.rs +++ b/src/test/run-pass/associated-const.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait Foo { const ID: i32; diff --git a/src/test/run-pass/auxiliary/associated-const-cc-lib.rs b/src/test/run-pass/auxiliary/associated-const-cc-lib.rs index 1fd8fee0117c5..e4cada40db3c9 100644 --- a/src/test/run-pass/auxiliary/associated-const-cc-lib.rs +++ b/src/test/run-pass/auxiliary/associated-const-cc-lib.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] #![crate_type="lib"] diff --git a/src/test/run-pass/issue-23808.rs b/src/test/run-pass/issue-23808.rs index 0302b11fdbb7b..1435a1b5d3878 100644 --- a/src/test/run-pass/issue-23808.rs +++ b/src/test/run-pass/issue-23808.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] #![deny(dead_code)] // use different types / traits to test all combinations diff --git a/src/test/run-pass/issue-24947.rs b/src/test/run-pass/issue-24947.rs index 2b0c90c4d15d4..19a364a93fd79 100644 --- a/src/test/run-pass/issue-24947.rs +++ b/src/test/run-pass/issue-24947.rs @@ -10,7 +10,6 @@ // #24947 ICE using a trait-associated const in an array size -#![feature(associated_consts)] struct Foo; diff --git a/src/test/run-pass/issue-25145.rs b/src/test/run-pass/issue-25145.rs index 6f02f2783818e..d5d23012e040b 100644 --- a/src/test/run-pass/issue-25145.rs +++ b/src/test/run-pass/issue-25145.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] struct S; diff --git a/src/test/run-pass/issue-26095.rs b/src/test/run-pass/issue-26095.rs index f34685c6936cb..9d8d9c3ff2e3b 100644 --- a/src/test/run-pass/issue-26095.rs +++ b/src/test/run-pass/issue-26095.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait HasNumber { const Number: usize; diff --git a/src/test/run-pass/issue-31267-additional.rs b/src/test/run-pass/issue-31267-additional.rs index a6b4252588786..06ab310f6d21f 100644 --- a/src/test/run-pass/issue-31267-additional.rs +++ b/src/test/run-pass/issue-31267-additional.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] #[derive(Clone, Copy, Debug)] struct Bar; diff --git a/src/test/run-pass/issue-31267.rs b/src/test/run-pass/issue-31267.rs index 90eb0f6c841ee..9cbdde4049164 100644 --- a/src/test/run-pass/issue-31267.rs +++ b/src/test/run-pass/issue-31267.rs @@ -10,7 +10,6 @@ // Regression test for issue #31267 -#![feature(associated_consts)] struct Foo; diff --git a/src/test/run-pass/issue-40136.rs b/src/test/run-pass/issue-40136.rs index db642812b4be4..488754af06fb8 100644 --- a/src/test/run-pass/issue-40136.rs +++ b/src/test/run-pass/issue-40136.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] macro_rules! m { () => { 0 } } diff --git a/src/test/rustdoc/assoc-consts.rs b/src/test/rustdoc/assoc-consts.rs index 8720d419a4de6..2edf61288f588 100644 --- a/src/test/rustdoc/assoc-consts.rs +++ b/src/test/rustdoc/assoc-consts.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] pub trait Foo { // @has assoc_consts/trait.Foo.html '//*[@class="rust trait"]' \ diff --git a/src/test/rustdoc/auxiliary/issue-36031.rs b/src/test/rustdoc/auxiliary/issue-36031.rs index 6b8a4b9f13703..6611cc428b0e1 100644 --- a/src/test/rustdoc/auxiliary/issue-36031.rs +++ b/src/test/rustdoc/auxiliary/issue-36031.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] pub trait Foo { const FOO: usize; diff --git a/src/test/rustdoc/const-doc.rs b/src/test/rustdoc/const-doc.rs index 9f70fe43175b9..9884e3d2c1995 100644 --- a/src/test/rustdoc/const-doc.rs +++ b/src/test/rustdoc/const-doc.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] use std::marker::PhantomData; diff --git a/src/test/rustdoc/issue-28478.rs b/src/test/rustdoc/issue-28478.rs index 493c08693e94a..c1141cb031e4f 100644 --- a/src/test/rustdoc/issue-28478.rs +++ b/src/test/rustdoc/issue-28478.rs @@ -9,7 +9,6 @@ // except according to those terms. #![feature(associated_type_defaults)] -#![feature(associated_consts)] // @has issue_28478/trait.Bar.html pub trait Bar { diff --git a/src/test/rustdoc/issue-31808.rs b/src/test/rustdoc/issue-31808.rs index 46be8229d7c65..20105babfd92d 100644 --- a/src/test/rustdoc/issue-31808.rs +++ b/src/test/rustdoc/issue-31808.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts, associated_types)] - // Test that associated item impls on primitive types don't crash rustdoc pub trait Foo { diff --git a/src/test/rustdoc/issue-33302.rs b/src/test/rustdoc/issue-33302.rs index a34ee908ef295..a6ff001b96fb3 100644 --- a/src/test/rustdoc/issue-33302.rs +++ b/src/test/rustdoc/issue-33302.rs @@ -11,7 +11,6 @@ // Ensure constant and array length values are not taken from source // code, which wreaks havoc with macros. -#![feature(associated_consts)] macro_rules! make { ($n:expr) => { diff --git a/src/test/ui/missing-items/auxiliary/m1.rs b/src/test/ui/missing-items/auxiliary/m1.rs index f8389692267e1..49fc586d6b52f 100644 --- a/src/test/ui/missing-items/auxiliary/m1.rs +++ b/src/test/ui/missing-items/auxiliary/m1.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] pub trait X { const CONSTANT: u32; diff --git a/src/test/ui/missing-items/m2.rs b/src/test/ui/missing-items/m2.rs index fc09039640b99..ffd7ff7f4323d 100644 --- a/src/test/ui/missing-items/m2.rs +++ b/src/test/ui/missing-items/m2.rs @@ -10,7 +10,6 @@ // aux-build:m1.rs -#![feature(associated_consts)] extern crate m1; diff --git a/src/test/ui/missing-items/m2.stderr b/src/test/ui/missing-items/m2.stderr index 51afb95b89611..ce061bd167a88 100644 --- a/src/test/ui/missing-items/m2.stderr +++ b/src/test/ui/missing-items/m2.stderr @@ -1,10 +1,10 @@ error[E0601]: main function not found error[E0046]: not all trait items implemented, missing: `CONSTANT`, `Type`, `method` - --> $DIR/m2.rs:20:1 + --> $DIR/m2.rs:19:1 | -20 | / impl m1::X for X { -21 | | } +19 | / impl m1::X for X { +20 | | } | |_^ missing `CONSTANT`, `Type`, `method` in implementation | = note: `CONSTANT` from trait: `const CONSTANT: u32;` diff --git a/src/test/ui/span/impl-wrong-item-for-trait.rs b/src/test/ui/span/impl-wrong-item-for-trait.rs index 54ed42af5d582..091df1d5dc898 100644 --- a/src/test/ui/span/impl-wrong-item-for-trait.rs +++ b/src/test/ui/span/impl-wrong-item-for-trait.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] use std::fmt::Debug; diff --git a/src/test/ui/span/impl-wrong-item-for-trait.stderr b/src/test/ui/span/impl-wrong-item-for-trait.stderr index 2c4c6a148d7b3..5812cab0d050a 100644 --- a/src/test/ui/span/impl-wrong-item-for-trait.stderr +++ b/src/test/ui/span/impl-wrong-item-for-trait.stderr @@ -1,86 +1,86 @@ error[E0437]: type `bar` is not a member of trait `Foo` - --> $DIR/impl-wrong-item-for-trait.rs:47:5 + --> $DIR/impl-wrong-item-for-trait.rs:46:5 | -47 | type bar = u64; +46 | type bar = u64; | ^^^^^^^^^^^^^^^ not a member of trait `Foo` error[E0323]: item `bar` is an associated const, which doesn't match its trait `Foo` - --> $DIR/impl-wrong-item-for-trait.rs:25:5 + --> $DIR/impl-wrong-item-for-trait.rs:24:5 | -16 | fn bar(&self); +15 | fn bar(&self); | -------------- item in trait ... -25 | const bar: u64 = 1; +24 | const bar: u64 = 1; | ^^^^^^^^^^^^^^^^^^^ does not match trait error[E0046]: not all trait items implemented, missing: `bar` - --> $DIR/impl-wrong-item-for-trait.rs:22:1 + --> $DIR/impl-wrong-item-for-trait.rs:21:1 | -16 | fn bar(&self); +15 | fn bar(&self); | -------------- `bar` from trait ... -22 | / impl Foo for FooConstForMethod { -23 | | //~^ ERROR E0046 -24 | | //~| NOTE missing `bar` in implementation -25 | | const bar: u64 = 1; +21 | / impl Foo for FooConstForMethod { +22 | | //~^ ERROR E0046 +23 | | //~| NOTE missing `bar` in implementation +24 | | const bar: u64 = 1; ... | -28 | | const MY_CONST: u32 = 1; -29 | | } +27 | | const MY_CONST: u32 = 1; +28 | | } | |_^ missing `bar` in implementation error[E0324]: item `MY_CONST` is an associated method, which doesn't match its trait `Foo` - --> $DIR/impl-wrong-item-for-trait.rs:37:5 + --> $DIR/impl-wrong-item-for-trait.rs:36:5 | -17 | const MY_CONST: u32; +16 | const MY_CONST: u32; | -------------------- item in trait ... -37 | fn MY_CONST() {} +36 | fn MY_CONST() {} | ^^^^^^^^^^^^^^^^ does not match trait error[E0046]: not all trait items implemented, missing: `MY_CONST` - --> $DIR/impl-wrong-item-for-trait.rs:33:1 + --> $DIR/impl-wrong-item-for-trait.rs:32:1 | -17 | const MY_CONST: u32; +16 | const MY_CONST: u32; | -------------------- `MY_CONST` from trait ... -33 | / impl Foo for FooMethodForConst { -34 | | //~^ ERROR E0046 -35 | | //~| NOTE missing `MY_CONST` in implementation -36 | | fn bar(&self) {} +32 | / impl Foo for FooMethodForConst { +33 | | //~^ ERROR E0046 +34 | | //~| NOTE missing `MY_CONST` in implementation +35 | | fn bar(&self) {} ... | -39 | | //~| NOTE does not match trait -40 | | } +38 | | //~| NOTE does not match trait +39 | | } | |_^ missing `MY_CONST` in implementation error[E0325]: item `bar` is an associated type, which doesn't match its trait `Foo` - --> $DIR/impl-wrong-item-for-trait.rs:47:5 + --> $DIR/impl-wrong-item-for-trait.rs:46:5 | -16 | fn bar(&self); +15 | fn bar(&self); | -------------- item in trait ... -47 | type bar = u64; +46 | type bar = u64; | ^^^^^^^^^^^^^^^ does not match trait error[E0046]: not all trait items implemented, missing: `bar` - --> $DIR/impl-wrong-item-for-trait.rs:44:1 + --> $DIR/impl-wrong-item-for-trait.rs:43:1 | -16 | fn bar(&self); +15 | fn bar(&self); | -------------- `bar` from trait ... -44 | / impl Foo for FooTypeForMethod { -45 | | //~^ ERROR E0046 -46 | | //~| NOTE missing `bar` in implementation -47 | | type bar = u64; +43 | / impl Foo for FooTypeForMethod { +44 | | //~^ ERROR E0046 +45 | | //~| NOTE missing `bar` in implementation +46 | | type bar = u64; ... | -50 | | const MY_CONST: u32 = 1; -51 | | } +49 | | const MY_CONST: u32 = 1; +50 | | } | |_^ missing `bar` in implementation error[E0046]: not all trait items implemented, missing: `fmt` - --> $DIR/impl-wrong-item-for-trait.rs:53:1 + --> $DIR/impl-wrong-item-for-trait.rs:52:1 | -53 | / impl Debug for FooTypeForMethod { -54 | | } +52 | / impl Debug for FooTypeForMethod { +53 | | } | |_^ missing `fmt` in implementation | = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>` diff --git a/src/test/ui/span/issue-29595.rs b/src/test/ui/span/issue-29595.rs index 79704619ccd37..ed7f2d1a92e75 100644 --- a/src/test/ui/span/issue-29595.rs +++ b/src/test/ui/span/issue-29595.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(associated_consts)] trait Tr { const C: Self; diff --git a/src/test/ui/span/issue-29595.stderr b/src/test/ui/span/issue-29595.stderr index abbac245f89f6..81ba0057d7173 100644 --- a/src/test/ui/span/issue-29595.stderr +++ b/src/test/ui/span/issue-29595.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `u8: Tr` is not satisfied - --> $DIR/issue-29595.rs:18:17 + --> $DIR/issue-29595.rs:17:17 | -18 | let a: u8 = Tr::C; //~ ERROR the trait bound `u8: Tr` is not satisfied +17 | let a: u8 = Tr::C; //~ ERROR the trait bound `u8: Tr` is not satisfied | ^^^^^ the trait `Tr` is not implemented for `u8` | = note: required by `Tr::C`