about summary refs log tree commit diff
path: root/compiler/rustc_span/src/source_map
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_span/src/source_map
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_span/src/source_map')
-rw-r--r--compiler/rustc_span/src/source_map/tests.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_span/src/source_map/tests.rs b/compiler/rustc_span/src/source_map/tests.rs
index 130522a302d..5788d11ed43 100644
--- a/compiler/rustc_span/src/source_map/tests.rs
+++ b/compiler/rustc_span/src/source_map/tests.rs
@@ -18,7 +18,7 @@ impl SourceMap {
     ///    * the LHS span must start at or before the RHS span.
     fn merge_spans(&self, sp_lhs: Span, sp_rhs: Span) -> Option<Span> {
         // Ensure we're at the same expansion ID.
-        if sp_lhs.ctxt() != sp_rhs.ctxt() {
+        if !sp_lhs.eq_ctxt(sp_rhs) {
             return None;
         }