Rollup merge of #127557 - linyihai:issue-126694, r=compiler-errors
Add a label to point to the lacking macro name definition Fixes https://github.com/rust-lang/rust/issues/126694, but adopts the suggestion from https://github.com/rust-lang/rust/issues/118295 ``` --> src/main.rs:1:14 | 1 | macro_rules! { | ^ put a macro name here ```
This commit is contained in:
commit
c5788d618e
6 changed files with 30 additions and 8 deletions
|
@ -1448,7 +1448,10 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
);
|
||||
|
||||
if macro_kind == MacroKind::Bang && ident.name == sym::macro_rules {
|
||||
err.subdiagnostic(MaybeMissingMacroRulesName { span: ident.span });
|
||||
let label_span = ident.span.shrink_to_hi();
|
||||
let mut spans = MultiSpan::from_span(label_span);
|
||||
spans.push_span_label(label_span, "put a macro name here");
|
||||
err.subdiagnostic(MaybeMissingMacroRulesName { spans: spans });
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue