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 @@ pub fn can_be_used_for_suggestions(self) -> bool {
// 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())))
}