Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/span/src/lib.rs')
-rw-r--r--crates/span/src/lib.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/span/src/lib.rs b/crates/span/src/lib.rs
index bfe7b2620d..8274a94edb 100644
--- a/crates/span/src/lib.rs
+++ b/crates/span/src/lib.rs
@@ -51,13 +51,20 @@ impl Span {
}
// Differing context, we can't merge these so prefer the one that's root
if self.ctx != other.ctx {
+ #[cfg(feature = "salsa")]
if self.ctx.is_root() {
return Some(other);
} else if other.ctx.is_root() {
return Some(self);
}
+ None
+ } else {
+ Some(Span {
+ range: self.range.cover(other.range),
+ anchor: other.anchor,
+ ctx: other.ctx,
+ })
}
- Some(Span { range: self.range.cover(other.range), anchor: other.anchor, ctx: other.ctx })
}
pub fn eq_ignoring_ctx(self, other: Self) -> bool {