Skip to content

Commit

Permalink
Simplify Span::can_be_used_for_suggestions a little tiny bit
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed Jul 30, 2023
1 parent 483ef5f commit a383878
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 a383878

Please sign in to comment.