Skip to content

Commit 433b324

Browse files
committed
Avoid tracking span to compute end_point.
1 parent 90277a8 commit 433b324

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/rustc_span/src/source_map.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,8 @@ impl SourceMap {
911911

912912
/// Returns a new span representing just the last character of this span.
913913
pub fn end_point(&self, sp: Span) -> Span {
914-
let sp = sp.data();
914+
// We restrict the current span, so we cannot look around. Using the untracked data is ok.
915+
let sp = sp.data_untracked();
915916
let pos = sp.hi.0;
916917

917918
let width = self.find_width_of_character_at_span(sp, false);

0 commit comments

Comments
 (0)