Skip to content

Commit ada4a64

Browse files
committed
Revert "pre-expansion gate decl_macro"
This reverts commit 1f470ce.
1 parent 680089c commit ada4a64

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

src/libsyntax/feature_gate/check.rs

+5
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,11 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
443443
"auto traits are experimental and possibly buggy");
444444
}
445445

446+
ast::ItemKind::MacroDef(ast::MacroDef { legacy: false, .. }) => {
447+
let msg = "`macro` is experimental";
448+
gate_feature_post!(&self, decl_macro, i.span, msg);
449+
}
450+
446451
ast::ItemKind::OpaqueTy(..) => {
447452
gate_feature_post!(
448453
&self,

src/test/ui/feature-gates/feature-gate-decl_macro.rs

-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,4 @@
22

33
macro m() {} //~ ERROR `macro` is experimental
44

5-
macro_rules! accept_item { ($i:item) => {} }
6-
accept_item! {
7-
macro m() {} //~ ERROR `macro` is experimental
8-
}
95
fn main() {}

src/test/ui/feature-gates/feature-gate-decl_macro.stderr

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

10-
error[E0658]: `macro` is experimental
11-
--> $DIR/feature-gate-decl_macro.rs:7:5
12-
|
13-
LL | macro m() {}
14-
| ^^^^^^^^^^^^
15-
|
16-
= note: for more information, see https://github.com/rust-lang/rust/issues/39412
17-
= help: add `#![feature(decl_macro)]` 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)