Skip to content

Commit aedaca9

Browse files
committed
Fix tests with Rust 1.55
Per rust-lang/rust#85746, Rust 1.55 has stopped returning io::ErrorKind::Other from within the standard library and instead returns better, more-specific error codes. This broke a test of ours that matched on `Other`. Address this by relaxing the test and only checking for an error, not the specific error type. Fixing this properly seems quite hard at this point per the added TODO.
1 parent 904e5d4 commit aedaca9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

std/src/storage/fs.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,11 @@ mod tests {
251251
let file = dir.path().join("not-a-dir");
252252
write_file(&file, &[]);
253253
let drive = DirectoryDrive::new(&file).unwrap();
254-
assert_eq!(io::ErrorKind::Other, block_on(drive.enumerate()).unwrap_err().kind());
254+
// TODO(jmmv): Check for the specific error that's returned. We used to check against
255+
// `Other` but Rust 1.55 started returning `NotADirectory` instead -- and unfortunately
256+
// using the latter relies on an unstable feature. So addressing this is non-trivial
257+
// right now, but will be over time.
258+
block_on(drive.enumerate()).unwrap_err();
255259
}
256260

257261
#[test]

0 commit comments

Comments
 (0)