Skip to content

Commit

Permalink
Revert "pre-expansion gate trait_alias."
Browse files Browse the repository at this point in the history
This reverts commit 2d182b8.
  • Loading branch information
eddyb committed Oct 31, 2019
1 parent 56d7bb2 commit 803616a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
9 changes: 9 additions & 0 deletions src/libsyntax/feature_gate/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
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
Expand Up @@ -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`.

0 comments on commit 803616a

Please sign in to comment.