Collapse if statements, change message to lowercase

This commit is contained in:
Tom Martin 2023-04-06 18:02:52 +01:00
parent 56207b8faf
commit be4416923d
No known key found for this signature in database
GPG Key ID: 73A733F9629F5AC5

View File

@ -548,12 +548,13 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
err.span_label(path.span, format!("not {} {}", article, expected)); err.span_label(path.span, format!("not {} {}", article, expected));
if !path.span.from_expansion() { // Suggest moving the macro out of the derive() as the macro isn't Derive
// Suggest moving the macro out of the derive() as the macro isn't Derive if !path.span.from_expansion()
if kind == MacroKind::Derive && ext.macro_kind() != MacroKind::Derive { && kind == MacroKind::Derive
err.span_help(path.span, "Remove from the surrounding `derive()`"); && ext.macro_kind() != MacroKind::Derive
err.help(format!("Add as non-Derive macro\n`#[{}]`", path_str)); {
} err.span_help(path.span, "remove from the surrounding `derive()`");
err.help(format!("add as non-Derive macro\n`#[{}]`", path_str));
} }
err.emit(); err.emit();