]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_span/src/tests.rs
Rollup merge of #98710 - mojave2:string, r=JohnTitor
[rust.git] / compiler / rustc_span / src / tests.rs
index 11edcacc0d43ba95917ffadae0dc14d44b3cfebd..5b3915c33387bb18689b48f31f59ff4d8353d117 100644 (file)
@@ -5,7 +5,7 @@ fn test_lookup_line() {
     let source = "abcdefghijklm\nabcdefghij\n...".to_owned();
     let sf =
         SourceFile::new(FileName::Anon(0), source, BytePos(3), SourceFileHashAlgorithm::Sha256);
-    assert_eq!(sf.lines.as_slice(), &[BytePos(3), BytePos(17), BytePos(28)]);
+    sf.lines(|lines| assert_eq!(lines, &[BytePos(3), BytePos(17), BytePos(28)]));
 
     assert_eq!(sf.lookup_line(BytePos(0)), None);
     assert_eq!(sf.lookup_line(BytePos(3)), Some(0));