1
Fork 0

rustc_span: Optimize syntax context comparisons

Including comparisons with root context
This commit is contained in:
Vadim Petrochenkov 2024-01-02 23:32:40 +03:00
parent b8c207435c
commit 90d11d6448
13 changed files with 76 additions and 52 deletions

View file

@ -1630,7 +1630,7 @@ impl<'tcx> Liveness<'_, 'tcx> {
let from_macro = non_shorthands
.iter()
.find(|(_, pat_span, ident_span)| {
pat_span.ctxt() != ident_span.ctxt() && pat_span.from_expansion()
!pat_span.eq_ctxt(*ident_span) && pat_span.from_expansion()
})
.map(|(_, pat_span, _)| *pat_span);
let non_shorthands = non_shorthands