rustc_span: Optimize syntax context comparisons
Including comparisons with root context
This commit is contained in:
parent
b8c207435c
commit
90d11d6448
13 changed files with 76 additions and 52 deletions
|
@ -72,7 +72,7 @@ pub(super) fn parse(
|
|||
// `SyntaxContext::root()` from a foreign crate will
|
||||
// have the edition of that crate (which we manually
|
||||
// retrieve via the `edition` parameter).
|
||||
if span.ctxt().is_root() {
|
||||
if !span.from_expansion() {
|
||||
edition
|
||||
} else {
|
||||
span.edition()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue