diff options
| author | Ben Kimock <kimockb@gmail.com> | 2023-04-07 23:11:20 -0400 |
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2023-04-18 10:52:47 -0400 |
| commit | 0445fbdd835c92156e4d06e42ce99a39e9315343 (patch) | |
| tree | 98214d1ae76737d58e423427cd7384b1f276230c /compiler/rustc_span/src/tests.rs | |
| parent | de96f3d8735b70d5dc1ca178aaee198b329b8f3d (diff) | |
| download | rust-0445fbdd835c92156e4d06e42ce99a39e9315343.tar.gz rust-0445fbdd835c92156e4d06e42ce99a39e9315343.zip | |
Store hashes in special types so they aren't accidentally encoded as numbers
Diffstat (limited to 'compiler/rustc_span/src/tests.rs')
| -rw-r--r-- | compiler/rustc_span/src/tests.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_span/src/tests.rs b/compiler/rustc_span/src/tests.rs index 5b3915c3338..a242ad6d1d7 100644 --- a/compiler/rustc_span/src/tests.rs +++ b/compiler/rustc_span/src/tests.rs @@ -3,8 +3,12 @@ use super::*; #[test] fn test_lookup_line() { let source = "abcdefghijklm\nabcdefghij\n...".to_owned(); - let sf = - SourceFile::new(FileName::Anon(0), source, BytePos(3), SourceFileHashAlgorithm::Sha256); + let sf = SourceFile::new( + FileName::Anon(Hash64::ZERO), + source, + BytePos(3), + SourceFileHashAlgorithm::Sha256, + ); sf.lines(|lines| assert_eq!(lines, &[BytePos(3), BytePos(17), BytePos(28)])); assert_eq!(sf.lookup_line(BytePos(0)), None); |
