Skip to content

Commit 0337e79

Browse files
authored
Merge pull request rust-lang#18784 from Veykril/push-pqtwsvquxoty
fix: Do not merge spans if they have different anchors
2 parents 54b75a1 + 1f0696d commit 0337e79

File tree

1 file changed

+1
-1
lines changed
  • src/tools/rust-analyzer/crates/syntax-bridge/src

1 file changed

+1
-1
lines changed

src/tools/rust-analyzer/crates/syntax-bridge/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ where
10581058
// We don't do what rustc does exactly, rustc does something clever when the spans have different syntax contexts
10591059
// but this runs afoul of our separation between `span` and `hir-expand`.
10601060
SpanData {
1061-
range: if a.ctx == b.ctx {
1061+
range: if a.ctx == b.ctx && a.anchor == b.anchor {
10621062
TextRange::new(
10631063
std::cmp::min(a.range.start(), b.range.start()),
10641064
std::cmp::max(a.range.end(), b.range.end()),

0 commit comments

Comments
 (0)