diff options
| author | bors <bors@rust-lang.org> | 2023-09-05 21:03:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-09-05 21:03:56 +0000 |
| commit | a991861ec9fd8aedffbe5744a8852c7c64dd40b2 (patch) | |
| tree | ea4300be75a907b849ce41f5e116b29d57b40f88 /src/tools/rustfmt | |
| parent | f91c53d73820251cc222356dcb65586469cf2018 (diff) | |
| parent | 3edeac06a5722e9b29c350a22e54b8cc1396c62d (diff) | |
| download | rust-a991861ec9fd8aedffbe5744a8852c7c64dd40b2.tar.gz rust-a991861ec9fd8aedffbe5744a8852c7c64dd40b2.zip | |
Auto merge of #115507 - cjgillot:relative-source-file, r=oli-obk
Use relative positions inside a SourceFile. This allows to remove the normalization of start positions for hashing, and simplify allocation of global address space. cc `@Zoxc`
Diffstat (limited to 'src/tools/rustfmt')
| -rw-r--r-- | src/tools/rustfmt/src/parse/session.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/rustfmt/src/parse/session.rs b/src/tools/rustfmt/src/parse/session.rs index d815d69d6ba..3f94bb29933 100644 --- a/src/tools/rustfmt/src/parse/session.rs +++ b/src/tools/rustfmt/src/parse/session.rs @@ -268,7 +268,7 @@ impl ParseSess { 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()), ) } |
