Rollup merge of #114258 - WaffleLapkin:reuse_in_derive_expansion, r=petrochenkov

Simplify `Span::can_be_used_for_suggestions` a little tiny bit

Just something I saw randomly.
This commit is contained in:
Matthias Krüger 2023-07-30 20:36:35 +02:00 committed by GitHub
commit 4916ab5330
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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, // 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 // the callsite span and the span will be pointing at different places. It also means that
// we can safely provide suggestions on this span. // 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()))) && self.parent_callsite().map(|p| (p.lo(), p.hi())) != Some((self.lo(), self.hi())))
} }