Skip to content

Commit 37af04f

Browse files
committed
Address review comments and CI failures
1 parent 15cefe4 commit 37af04f

13 files changed

+7
-30
lines changed

src/librustc_resolve/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ impl<'a> base::Resolver for Resolver<'a> {
186186
Ok((def, ext)) => (def, ext),
187187
Err(Determinacy::Determined) if kind == MacroKind::Attr => {
188188
// Replace unresolved attributes with used inert attributes for better recovery.
189-
return Ok(Some(self.get_macro(Def::NonMacroAttr(NonMacroAttrKind::Tool))));
189+
return Ok(Some(Lrc::new(SyntaxExtension::NonMacroAttr { mark_used: true })));
190190
}
191191
Err(determinacy) => return Err(determinacy),
192192
};

src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2871,6 +2871,7 @@ impl<'a> Parser<'a> {
28712871
let mut err = self.fatal(&format!("unknown macro variable `{}`", name));
28722872
err.span_label(self.span, "unknown macro variable");
28732873
err.emit();
2874+
self.bump();
28742875
return
28752876
}
28762877
token::Interpolated(ref nt) => {

src/test/ui/issues/issue-6596-1.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ macro_rules! e {
22
($inp:ident) => (
33
$nonexistent
44
//~^ ERROR unknown macro variable `nonexistent`
5-
//~| ERROR cannot find value `nonexistent` in this scope
65
);
76
}
87

src/test/ui/issues/issue-6596-1.stderr

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,5 @@ LL | $nonexistent
77
LL | e!(foo);
88
| -------- in this macro invocation
99

10-
error[E0425]: cannot find value `nonexistent` in this scope
11-
--> $DIR/issue-6596-1.rs:14:9
12-
|
13-
LL | $nonexistent
14-
| ^^^^^^^^^^^^ not found in this scope
15-
...
16-
LL | e!(foo);
17-
| -------- in this macro invocation
18-
19-
error: aborting due to 2 previous errors
10+
error: aborting due to previous error
2011

21-
For more information about this error, try `rustc --explain E0425`.

src/test/ui/issues/issue-6596-2.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ macro_rules! g {
44
($inp:ident) => (
55
{ $inp $nonexistent }
66
//~^ ERROR unknown macro variable `nonexistent`
7-
//~| ERROR expected one of
87
);
98
}
109

src/test/ui/issues/issue-6596-2.stderr

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,4 @@ LL | { $inp $nonexistent }
77
LL | g!(foo);
88
| -------- in this macro invocation
99

10-
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `nonexistent`
11-
--> $DIR/issue-6596-2.rs:5:16
12-
|
13-
LL | { $inp $nonexistent }
14-
| ^^^^^^^^^^^^ expected one of 8 possible tokens here
15-
...
16-
LL | g!(foo);
17-
| -------- in this macro invocation
18-
19-
error: aborting due to 2 previous errors
20-
10+
error: aborting due to previous error

0 commit comments

Comments
 (0)