From 548ba13265c702cf98a163fc11e5bc04c57d2121 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sun, 3 Sep 2023 12:45:23 +0000 Subject: Register the file while computing its start position. --- compiler/rustc_span/src/tests.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_span/src/tests.rs') 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)]) -- cgit 1.4.1-3-g733a5