Simplify Span::can_be_used_for_suggestions a little tiny bit

This commit is contained in:
Maybe Waffle 2023-07-30 15:37:39 +00:00
parent 483ef5f4d8
commit a3838780f2

View File

@ -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())))
}