Skip to content

Commit

Permalink
Rollup merge of #114258 - WaffleLapkin:reuse_in_derive_expansion, r=p…
Browse files Browse the repository at this point in the history
…etrochenkov

Simplify `Span::can_be_used_for_suggestions` a little tiny bit

Just something I saw randomly.
  • Loading branch information
matthiaskrgr authored Jul 30, 2023
2 parents 97bacad + a383878 commit 4916ab5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_span/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())))
}

Expand Down

0 comments on commit 4916ab5

Please sign in to comment.