about summary refs log tree commit diff
path: root/compiler/rustc_span/src/tests.rs
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-09-03 12:45:23 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-09-03 15:02:46 +0000
commit548ba13265c702cf98a163fc11e5bc04c57d2121 (patch)
treeb0620bf9b86cbe491d45336145ae6b190d310e11 /compiler/rustc_span/src/tests.rs
parent258ace613da6b8c90ba4995738cb13791388c4bb (diff)
downloadrust-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.rs3
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)])