Auto merge of #2022 - RalfJung:remove_dir_all, r=RalfJung

test remove_dir_all

Blocked on https://github.com/rust-lang/rust/pull/94749

Cc https://github.com/rust-lang/miri/issues/1966
This commit is contained in:
bors 2022-03-20 14:38:27 +00:00
commit a64e6fd1b6
3 changed files with 7 additions and 2 deletions

View File

@ -1 +1 @@
e95b10ba4ac4564ed25f7eef143e3182c33b3902
c7ce69faf2a7ea16c15d922985ca27ba70da30ee

View File

@ -17,7 +17,6 @@ impl Dlsym {
pub fn from_str(name: &str) -> InterpResult<'static, Option<Dlsym>> {
Ok(match name {
"getentropy" => Some(Dlsym::getentropy),
"openat" => None, // std has a fallback for this
_ => throw_unsup_format!("unsupported macOS dlsym: {}", name),
})
}

View File

@ -395,6 +395,12 @@ fn test_directory() {
remove_dir(&dir_path).unwrap();
// Reading the metadata of a non-existent directory should fail with a "not found" error.
assert_eq!(ErrorKind::NotFound, check_metadata(&[], &dir_path).unwrap_err().kind());
// To test remove_dir_all, re-create the directory with a file and a directory in it.
create_dir(&dir_path).unwrap();
drop(File::create(&path_1).unwrap());
create_dir(&path_2).unwrap();
remove_dir_all(&dir_path).unwrap();
}
fn test_dup_stdout_stderr() {