Use relative positions inside a SourceFile.

This commit is contained in:
Camille GILLOT 2023-09-03 10:15:35 +00:00
parent eb349e35aa
commit 45e19aa80c

View File

@ -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; let source_file = self.parse_sess.source_map().lookup_char_pos(span.lo()).file;
SnippetProvider::new( SnippetProvider::new(
source_file.start_pos, source_file.start_pos,
source_file.end_pos, source_file.end_position(),
Lrc::clone(source_file.src.as_ref().unwrap()), Lrc::clone(source_file.src.as_ref().unwrap()),
) )
} }