Remove incorrect span for second label inner macro invocation
This commit is contained in:
@@ -772,6 +772,11 @@ impl<'a> Parser<'a> {
|
|||||||
// | expected one of 8 possible tokens here
|
// | expected one of 8 possible tokens here
|
||||||
err.span_label(self.span, label_exp);
|
err.span_label(self.span, label_exp);
|
||||||
}
|
}
|
||||||
|
_ if self.prev_span == syntax_pos::DUMMY_SP => {
|
||||||
|
// Account for macro context where the previous span might not be
|
||||||
|
// available to avoid incorrect output (#54841).
|
||||||
|
err.span_label(self.span, "unexpected token");
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
err.span_label(sp, label_exp);
|
err.span_label(sp, label_exp);
|
||||||
err.span_label(self.span, "unexpected token");
|
err.span_label(self.span, "unexpected token");
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
error: expected one of `crate`, `fn`, `pub`, `static`, or `type`, found `let`
|
error: expected one of `crate`, `fn`, `pub`, `static`, or `type`, found `let`
|
||||||
--> $DIR/issue-54441.rs:5:9
|
--> $DIR/issue-54441.rs:5:9
|
||||||
|
|
|
|
||||||
LL | #![feature(macros_in_extern)]
|
|
||||||
| - expected one of `crate`, `fn`, `pub`, `static`, or `type` here
|
|
||||||
...
|
|
||||||
LL | let //~ ERROR expected
|
LL | let //~ ERROR expected
|
||||||
| ^^^ unexpected token
|
| ^^^ unexpected token
|
||||||
...
|
...
|
||||||
|
|||||||
Reference in New Issue
Block a user