about summary refs log tree commit diff
diff options
context:
space:
mode:
authorivmarkov <ivan.markov@gmail.com>2022-01-21 09:41:13 +0200
committerivmarkov <ivan.markov@gmail.com>2022-01-21 09:41:13 +0200
commit495c7b31aaef783c583d2a0304002367df0a1474 (patch)
tree8495fea298a4dc677027d8e948cd728e1504e6d6
parent523be2e05da322daaecf1ecc8f2c0d625f5f46e3 (diff)
downloadrust-495c7b31aaef783c583d2a0304002367df0a1474.tar.gz
rust-495c7b31aaef783c583d2a0304002367df0a1474.zip
Fix STD compilation for the ESP-IDF target
-rw-r--r--library/std/src/sys/unix/fs.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs
index f8deda93fe2..ad656582a09 100644
--- a/library/std/src/sys/unix/fs.rs
+++ b/library/std/src/sys/unix/fs.rs
@@ -1448,8 +1448,8 @@ pub fn chroot(dir: &Path) -> io::Result<()> {
 
 pub use remove_dir_impl::remove_dir_all;
 
-// Fallback for REDOX
-#[cfg(target_os = "redox")]
+// Fallback for REDOX and ESP-IDF
+#[cfg(any(target_os = "redox", target_os = "espidf"))]
 mod remove_dir_impl {
     pub use crate::sys_common::fs::remove_dir_all;
 }
@@ -1573,7 +1573,11 @@ mod remove_dir_impl {
 }
 
 // Modern implementation using openat(), unlinkat() and fdopendir()
-#[cfg(not(any(all(target_os = "macos", target_arch = "x86_64"), target_os = "redox")))]
+#[cfg(not(any(
+    all(target_os = "macos", target_arch = "x86_64"),
+    target_os = "redox",
+    target_os = "espidf"
+)))]
 mod remove_dir_impl {
     use super::{cstr, lstat, Dir, DirEntry, InnerReadDir, ReadDir};
     use crate::ffi::CStr;