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

+1-1
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

+1
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

-1
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

+1-11
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

-1
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

+1-11
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

src/test/ui/macros/macro-comma-behavior.core.stderr

+1-4
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,4 @@ error: `#[panic_handler]` function required, but not found
4444

4545
error: language item required, but not found: `eh_personality`
4646

47-
error: language item required, but not found: `eh_unwind_resume`
48-
49-
error: aborting due to 10 previous errors
50-
47+
error: aborting due to 9 previous errors

src/test/ui/macros/macro-comma-behavior.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
// compile-flags: -C debug_assertions=yes
44
// revisions: std core
55

6+
#![feature(lang_items)]
67
#![cfg_attr(core, no_std)]
78

89
#[cfg(std)] use std::fmt;
910
#[cfg(core)] use core::fmt;
11+
#[cfg(core)] #[lang = "eh_unwind_resume"] fn eh_unwind_resume() {}
1012

1113
// (see documentation of the similarly-named test in run-pass)
1214
fn to_format_or_not_to_format() {

src/test/ui/macros/macro-comma-behavior.std.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,3 @@ LL | write!(f, "{}",)?;
5959
| ^^
6060

6161
error: aborting due to 10 previous errors
62-

0 commit comments

Comments
 (0)