Skip to content

Commit e5460fe

Browse files
committed
mbe: Make a missing macro_attr feature non-fatal
Parse the macro and its attr rules anyway, after emitting the error.
1 parent 28aec31 commit e5460fe

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/rustc_expand/src/mbe/macro_rules.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,8 @@ pub fn compile_declarative_macro(
556556
let args = if p.eat_keyword_noexpect(sym::attr) {
557557
has_attr_rules = true;
558558
if !features.macro_attr() {
559-
let msg = "`macro_rules!` attributes are unstable";
560-
let e = feature_err(sess, sym::macro_attr, span, msg);
561-
return dummy_syn_ext(e.emit());
559+
feature_err(sess, sym::macro_attr, span, "`macro_rules!` attributes are unstable")
560+
.emit();
562561
}
563562
if let Some(guar) = check_no_eof(sess, &p, "expected macro attr args") {
564563
return dummy_syn_ext(guar);

0 commit comments

Comments
 (0)