Skip help messages if macro span is from macro
This commit is contained in:
parent
86230dcde6
commit
56207b8faf
1 changed files with 5 additions and 3 deletions
|
@ -548,11 +548,13 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
|
||||
err.span_label(path.span, format!("not {} {}", article, expected));
|
||||
|
||||
if kind == MacroKind::Derive && ext.macro_kind() != MacroKind::Derive {
|
||||
if !path.span.from_expansion() {
|
||||
// Suggest moving the macro out of the derive() as the macro isn't Derive
|
||||
if kind == MacroKind::Derive && ext.macro_kind() != MacroKind::Derive {
|
||||
err.span_help(path.span, "Remove from the surrounding `derive()`");
|
||||
err.help(format!("Add as non-Derive macro\n`#[{}]`", path_str));
|
||||
}
|
||||
}
|
||||
|
||||
err.emit();
|
||||
return Ok((self.dummy_ext(kind), Res::Err));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue