1
Fork 0

Skip locking span interner for some syntax context checks

This commit is contained in:
Alex Macleod 2024-07-25 17:53:29 +00:00
parent 28e684b470
commit ad3f3c7fb6
2 changed files with 11 additions and 9 deletions

View file

@ -564,12 +564,6 @@ impl Span {
!self.is_dummy() && sm.is_span_accessible(self)
}
/// Returns `true` if this span comes from any kind of macro, desugaring or inlining.
#[inline]
pub fn from_expansion(self) -> bool {
!self.ctxt().is_root()
}
/// Returns `true` if `span` originates in a derive-macro's expansion.
pub fn in_derive_expansion(self) -> bool {
matches!(self.ctxt().outer_expn_data().kind, ExpnKind::Macro(MacroKind::Derive, _))