about summary refs log tree commit diff
path: root/compiler/rustc_expand/src
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2024-01-02 23:32:40 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2024-01-06 01:25:20 +0300
commit90d11d64486bc758ee15a1dd5dba351447648097 (patch)
tree5a1e15c159733163020096bdc77055b072ca2ed9 /compiler/rustc_expand/src
parentb8c207435c85955d0c0806240d5491f5ccd1def5 (diff)
downloadrust-90d11d64486bc758ee15a1dd5dba351447648097.tar.gz
rust-90d11d64486bc758ee15a1dd5dba351447648097.zip
rustc_span: Optimize syntax context comparisons
Including comparisons with root context
Diffstat (limited to 'compiler/rustc_expand/src')
-rw-r--r--compiler/rustc_expand/src/mbe/quoted.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_expand/src/mbe/quoted.rs b/compiler/rustc_expand/src/mbe/quoted.rs
index 445be01bc97..cd4ba7a9a62 100644
--- a/compiler/rustc_expand/src/mbe/quoted.rs
+++ b/compiler/rustc_expand/src/mbe/quoted.rs
@@ -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()