Skip to content

Commit 5000107

Browse files
committed
Auto merge of rust-lang#103075 - SUPERCILEX:miri-metadata, r=thomcc
Support DirEntry metadata calls in miri This should work as it uses lstat64 which is supported here: ~https://github.com/rust-lang/miri/blob/d9ad25ee4bbd9364c498959cdc82b5fa6c41e63c/src/shims/unix/macos/foreign_items.rs#L42~ just noticed that's macos, linux would be using statx: https://github.com/rust-lang/miri/blob/86f0e63b21721fe2c14608644f467b9cb21945eb/src/shims/unix/linux/foreign_items.rs#L112 The failing syscall is `dirfd`, so maybe that should actually be added to the shims?
2 parents 6e3455b + 6f852b5 commit 5000107

File tree

1 file changed

+8
-0
lines changed
  • tests/pass-dep/shims

1 file changed

+8
-0
lines changed

tests/pass-dep/shims/fs.rs

+8
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,14 @@ fn test_directory() {
404404
let mut file_names = dir_iter.map(|e| e.unwrap().file_name()).collect::<Vec<_>>();
405405
file_names.sort_unstable();
406406
assert_eq!(file_names, vec!["test_file_1", "test_file_2"]);
407+
// Test that read_dir metadata calls succeed
408+
assert_eq!(
409+
&[true, true],
410+
&*read_dir(&dir_path)
411+
.unwrap()
412+
.map(|e| e.unwrap().metadata().unwrap().is_file())
413+
.collect::<Vec<_>>()
414+
);
407415
// Deleting the directory should fail, since it is not empty.
408416
assert_eq!(ErrorKind::DirectoryNotEmpty, remove_dir(&dir_path).unwrap_err().kind());
409417
// Clean up the files in the directory

0 commit comments

Comments
 (0)