Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove associated_consts feature gate #42809

Merged
merged 1 commit into from
Jul 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 0 additions & 85 deletions src/doc/unstable-book/src/language-features/associated-consts.md

This file was deleted.

3 changes: 2 additions & 1 deletion src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -94,6 +93,8 @@
#![feature(untagged_unions)]
#![feature(unwind_attributes)]

#![cfg_attr(stage0, feature(associated_consts))]

#[prelude_import]
#[allow(unused)]
use prelude::v1::*;
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -42,6 +41,8 @@
#![feature(trace_macros)]
#![feature(test)]

#![cfg_attr(stage0, feature(associated_consts))]

#![recursion_limit="256"]

extern crate arena;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_bitflags/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -31,7 +32,6 @@ extern crate std;
///
/// ```{.rust}
/// #![feature(rustc_private)]
/// #![feature(associated_consts)]
/// #[macro_use] extern crate rustc_bitflags;
///
/// bitflags! {
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_borrowck/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_data_structures/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
#![feature(nonzero)]
#![feature(unboxed_closures)]
#![feature(fn_traits)]
#![feature(associated_consts)]
#![feature(unsize)]
#![feature(i128_type)]
#![feature(conservative_impl_trait)]
#![feature(discriminant_value)]
#![feature(specialization)]
#![feature(manually_drop)]

#![cfg_attr(stage0, feature(associated_consts))]
#![cfg_attr(stage0, feature(struct_field_attributes))]

#![cfg_attr(unix, feature(libc))]
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_llvm/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_mir/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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]
Expand Down
2 changes: 0 additions & 2 deletions src/librustc_resolve/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_trans/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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;

Expand Down
18 changes: 0 additions & 18 deletions src/librustc_typeck/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -2810,8 +2808,6 @@ impl Foo for Bar {
Or:

```
#![feature(associated_consts)]

struct Bar;

trait Foo {
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -2906,8 +2896,6 @@ impl Foo for Bar {
Or:

```
#![feature(associated_consts)]

struct Bar;

trait Foo {
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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.
Expand Down
17 changes: 3 additions & 14 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
1 change: 0 additions & 1 deletion src/test/compile-fail/E0164.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(associated_consts)]

enum Foo {}

Expand Down
Loading