Skip to content

Commit 4c3a353

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 76358a5 commit 4c3a353

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
@@ -555,9 +555,8 @@ pub fn compile_declarative_macro(
555555
let args = if p.eat_keyword_noexpect(sym::attr) {
556556
has_attr_rules = true;
557557
if !features.macro_attr() {
558-
let msg = "`macro_rules!` attributes are unstable";
559-
let e = feature_err(sess, sym::macro_attr, span, msg);
560-
return dummy_syn_ext(e.emit());
558+
feature_err(sess, sym::macro_attr, span, "`macro_rules!` attributes are unstable")
559+
.emit();
561560
}
562561
if let Some(guar) = check_no_eof(sess, &p, "expected macro attr args") {
563562
return dummy_syn_ext(guar);

0 commit comments

Comments
 (0)