Skip to content

Commit 34bd86a

Browse files
committed
Add label when replacing primary DUMMY_SP in macro expansion
1 parent ea9ccb6 commit 34bd86a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/libsyntax/ext/tt/macro_rules.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ impl<'a> ParserAnyMacro<'a> {
5353
let fragment = panictry!(parser.parse_ast_fragment(kind, true).map_err(|mut e| {
5454
if e.span.is_dummy() { // Get around lack of span in error (#30128)
5555
e.set_span(site_span);
56+
e.span_label(site_span, "in this macro expansion");
5657
} else if parser.token == token::Eof { // (#52866)
5758
e.set_span(parser.sess.source_map().next_point(parser.span));
5859
}

src/test/ui/macros/macro-in-expression-context-2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: expected expression, found the end of the macro arm
22
--> $DIR/macro-in-expression-context-2.rs:5:16
33
|
44
LL | _ => { empty!() }
5-
| ^^^^^^^^
5+
| ^^^^^^^^ in this macro expansion
66

77
error: aborting due to previous error
88

0 commit comments

Comments
 (0)