Skip to content

Commit 803616a

Browse files
committed
Revert "pre-expansion gate trait_alias."
This reverts commit 2d182b8.
1 parent 56d7bb2 commit 803616a

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

src/libsyntax/feature_gate/check.rs

+9
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,15 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
446446
"auto traits are experimental and possibly buggy");
447447
}
448448

449+
ast::ItemKind::TraitAlias(..) => {
450+
gate_feature_post!(
451+
&self,
452+
trait_alias,
453+
i.span,
454+
"trait aliases are experimental"
455+
);
456+
}
457+
449458
ast::ItemKind::MacroDef(ast::MacroDef { legacy: false, .. }) => {
450459
let msg = "`macro` is experimental";
451460
gate_feature_post!(&self, decl_macro, i.span, msg);
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
trait Foo = Default;
22
//~^ ERROR trait aliases are experimental
33

4-
macro_rules! accept_item {
5-
($i:item) => {}
6-
}
7-
8-
accept_item! {
9-
trait Foo = Ord + Eq;
10-
//~^ ERROR trait aliases are experimental
11-
}
12-
134
fn main() {}

src/test/ui/feature-gates/feature-gate-trait-alias.stderr

+1-10
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ LL | trait Foo = Default;
77
= note: for more information, see https://github.com/rust-lang/rust/issues/41517
88
= help: add `#![feature(trait_alias)]` to the crate attributes to enable
99

10-
error[E0658]: trait aliases are experimental
11-
--> $DIR/feature-gate-trait-alias.rs:9:5
12-
|
13-
LL | trait Foo = Ord + Eq;
14-
| ^^^^^^^^^^^^^^^^^^^^^
15-
|
16-
= note: for more information, see https://github.com/rust-lang/rust/issues/41517
17-
= help: add `#![feature(trait_alias)]` to the crate attributes to enable
18-
19-
error: aborting due to 2 previous errors
10+
error: aborting due to previous error
2011

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

0 commit comments

Comments
 (0)