diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-09-03 12:45:23 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-09-03 15:02:46 +0000 |
| commit | 548ba13265c702cf98a163fc11e5bc04c57d2121 (patch) | |
| tree | b0620bf9b86cbe491d45336145ae6b190d310e11 /compiler/rustc_span/src/tests.rs | |
| parent | 258ace613da6b8c90ba4995738cb13791388c4bb (diff) | |
| download | rust-548ba13265c702cf98a163fc11e5bc04c57d2121.tar.gz rust-548ba13265c702cf98a163fc11e5bc04c57d2121.zip | |
Register the file while computing its start position.
Diffstat (limited to 'compiler/rustc_span/src/tests.rs')
| -rw-r--r-- | compiler/rustc_span/src/tests.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_span/src/tests.rs b/compiler/rustc_span/src/tests.rs index 3b69295bb93..a980ee8d9e0 100644 --- a/compiler/rustc_span/src/tests.rs +++ b/compiler/rustc_span/src/tests.rs @@ -4,7 +4,8 @@ use super::*; fn test_lookup_line() { let source = "abcdefghijklm\nabcdefghij\n...".to_owned(); let mut sf = - SourceFile::new(FileName::Anon(Hash64::ZERO), source, SourceFileHashAlgorithm::Sha256); + SourceFile::new(FileName::Anon(Hash64::ZERO), source, SourceFileHashAlgorithm::Sha256) + .unwrap(); sf.start_pos = BytePos(3); sf.lines(|lines| { assert_eq!(lines, &[RelativeBytePos(0), RelativeBytePos(14), RelativeBytePos(25)]) |
