diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs index 03684608f75a..ef8a57bdd2e6 100644 --- a/library/std/src/sys/unix/fs.rs +++ b/library/std/src/sys/unix/fs.rs @@ -1480,14 +1480,14 @@ pub fn chroot(dir: &Path) -> io::Result<()> { pub use remove_dir_impl::remove_dir_all; -// Fallback for REDOX and ESP-IDF -#[cfg(any(target_os = "redox", target_os = "espidf"))] +// Fallback for REDOX and ESP-IDF (and Miri) +#[cfg(any(target_os = "redox", target_os = "espidf", miri))] mod remove_dir_impl { pub use crate::sys_common::fs::remove_dir_all; } // Modern implementation using openat(), unlinkat() and fdopendir() -#[cfg(not(any(target_os = "redox", target_os = "espidf")))] +#[cfg(not(any(target_os = "redox", target_os = "espidf", miri)))] mod remove_dir_impl { use super::{cstr, lstat, Dir, DirEntry, InnerReadDir, ReadDir}; use crate::ffi::CStr;