From be4416923d2f88a845eb5ea49b1daac9517935b8 Mon Sep 17 00:00:00 2001 From: Tom Martin Date: Thu, 6 Apr 2023 18:02:52 +0100 Subject: [PATCH] Collapse if statements, change message to lowercase --- compiler/rustc_resolve/src/macros.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index b595dc06801..ed479d289d7 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -548,12 +548,13 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { 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 - 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)); - } + // Suggest moving the macro out of the derive() as the macro isn't Derive + if !path.span.from_expansion() + && 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();