Skip to content

Commit a383878

Browse files
committed
Simplify Span::can_be_used_for_suggestions a little tiny bit
1 parent 483ef5f commit a383878

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_span/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ impl Span {
605605
// FIXME: If this span comes from a `derive` macro but it points at code the user wrote,
606606
// the callsite span and the span will be pointing at different places. It also means that
607607
// we can safely provide suggestions on this span.
608-
|| (matches!(self.ctxt().outer_expn_data().kind, ExpnKind::Macro(MacroKind::Derive, _))
608+
|| (self.in_derive_expansion()
609609
&& self.parent_callsite().map(|p| (p.lo(), p.hi())) != Some((self.lo(), self.hi())))
610610
}
611611

0 commit comments

Comments
 (0)