diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2023-08-31 22:12:47 +0200 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2023-09-07 13:05:05 +0200 |
| commit | f49382c0508db608aa9c33d6a8c77d2955d8f62c (patch) | |
| tree | 85be68eacbc6325822cf64fba8e4841474065607 /compiler/rustc_query_system/src | |
| parent | c5996b80beaba54502fa86583b48cd6980b17b18 (diff) | |
| download | rust-f49382c0508db608aa9c33d6a8c77d2955d8f62c.tar.gz rust-f49382c0508db608aa9c33d6a8c77d2955d8f62c.zip | |
Use `Freeze` for `SourceFile.lines`
Diffstat (limited to 'compiler/rustc_query_system/src')
| -rw-r--r-- | compiler/rustc_query_system/src/ich/impls_syntax.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_query_system/src/ich/impls_syntax.rs b/compiler/rustc_query_system/src/ich/impls_syntax.rs index f2b13f95def..b2177be0e36 100644 --- a/compiler/rustc_query_system/src/ich/impls_syntax.rs +++ b/compiler/rustc_query_system/src/ich/impls_syntax.rs @@ -79,15 +79,16 @@ impl<'a> HashStable<StableHashingContext<'a>> for SourceFile { src_hash.hash_stable(hcx, hasher); - // We are always in `Lines` form by the time we reach here. - assert!(self.lines.borrow().is_lines()); - self.lines(|lines| { + { + // We are always in `Lines` form by the time we reach here. + assert!(self.lines.read().is_lines()); + let lines = self.lines(); // We only hash the relative position within this source_file lines.len().hash_stable(hcx, hasher); for &line in lines.iter() { line.hash_stable(hcx, hasher); } - }); + } // We only hash the relative position within this source_file multibyte_chars.len().hash_stable(hcx, hasher); |
