From a3838780f21b56377f1002476b17c6d91070cbfc Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Sun, 30 Jul 2023 15:37:39 +0000 Subject: [PATCH] Simplify `Span::can_be_used_for_suggestions` a little tiny bit --- compiler/rustc_span/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index ecaa82874a3..fbd9bf05528 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -605,7 +605,7 @@ impl Span { // FIXME: If this span comes from a `derive` macro but it points at code the user wrote, // the callsite span and the span will be pointing at different places. It also means that // we can safely provide suggestions on this span. - || (matches!(self.ctxt().outer_expn_data().kind, ExpnKind::Macro(MacroKind::Derive, _)) + || (self.in_derive_expansion() && self.parent_callsite().map(|p| (p.lo(), p.hi())) != Some((self.lo(), self.hi()))) }