From 45e19aa80c9dfbaff383c6ecc173d2eab2190670 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sun, 3 Sep 2023 10:15:35 +0000 Subject: [PATCH] Use relative positions inside a SourceFile. --- src/parse/session.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parse/session.rs b/src/parse/session.rs index d815d69d6ba..3f94bb29933 100644 --- a/src/parse/session.rs +++ b/src/parse/session.rs @@ -268,7 +268,7 @@ pub(crate) fn snippet_provider(&self, span: Span) -> SnippetProvider { let source_file = self.parse_sess.source_map().lookup_char_pos(span.lo()).file; SnippetProvider::new( source_file.start_pos, - source_file.end_pos, + source_file.end_position(), Lrc::clone(source_file.src.as_ref().unwrap()), ) }