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

Partially revert the early feature-gatings added in #65742. #66004

Merged
merged 12 commits into from
Nov 2, 2019
9 changes: 9 additions & 0 deletions src/libsyntax/feature_gate/check.rs
Original file line number Diff line number Diff line change
@@ -446,6 +446,15 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
"auto traits are experimental and possibly buggy");
}

ast::ItemKind::TraitAlias(..) => {
gate_feature_post!(
&self,
trait_alias,
i.span,
"trait aliases are experimental"
);
}

ast::ItemKind::MacroDef(ast::MacroDef { legacy: false, .. }) => {
let msg = "`macro` is experimental";
gate_feature_post!(&self, decl_macro, i.span, msg);
9 changes: 0 additions & 9 deletions src/test/ui/feature-gates/feature-gate-trait-alias.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
trait Foo = Default;
//~^ ERROR trait aliases are experimental

macro_rules! accept_item {
($i:item) => {}
}

accept_item! {
trait Foo = Ord + Eq;
//~^ ERROR trait aliases are experimental
}

fn main() {}
11 changes: 1 addition & 10 deletions src/test/ui/feature-gates/feature-gate-trait-alias.stderr
Original file line number Diff line number Diff line change
@@ -7,15 +7,6 @@ LL | trait Foo = Default;
= note: for more information, see https://github.com/rust-lang/rust/issues/41517
= help: add `#![feature(trait_alias)]` to the crate attributes to enable

error[E0658]: trait aliases are experimental
--> $DIR/feature-gate-trait-alias.rs:9:5
|
LL | trait Foo = Ord + Eq;
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/41517
= help: add `#![feature(trait_alias)]` to the crate attributes to enable

error: aborting due to 2 previous errors
error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.