Skip to content

Commit c2d5c64

Browse files
Fix build on i686-apple-darwin systems
Replace `target_arch = "x86_64"` with `not(target_arch = "aarch64")` so that i686-apple-darwin systems dynamically choose implementation.
1 parent 600ec28 commit c2d5c64

File tree

1 file changed

+5
-5
lines changed
  • library/std/src/sys/unix

1 file changed

+5
-5
lines changed

library/std/src/sys/unix/fs.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1535,12 +1535,12 @@ mod remove_dir_impl {
15351535
use crate::sync::Arc;
15361536
use crate::sys::{cvt, cvt_r};
15371537

1538-
#[cfg(not(all(target_os = "macos", target_arch = "x86_64"),))]
1538+
#[cfg(not(all(target_os = "macos", not(target_arch = "aarch64")),))]
15391539
use libc::{fdopendir, openat, unlinkat};
1540-
#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
1540+
#[cfg(all(target_os = "macos", not(target_arch = "aarch64")))]
15411541
use macos_weak::{fdopendir, openat, unlinkat};
15421542

1543-
#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
1543+
#[cfg(all(target_os = "macos", not(target_arch = "aarch64")))]
15441544
mod macos_weak {
15451545
use crate::sys::weak::weak;
15461546
use libc::{c_char, c_int, DIR};
@@ -1699,12 +1699,12 @@ mod remove_dir_impl {
16991699
}
17001700
}
17011701

1702-
#[cfg(not(all(target_os = "macos", target_arch = "x86_64")))]
1702+
#[cfg(not(all(target_os = "macos", not(target_arch = "aarch64"))))]
17031703
pub fn remove_dir_all(p: &Path) -> io::Result<()> {
17041704
remove_dir_all_modern(p)
17051705
}
17061706

1707-
#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
1707+
#[cfg(all(target_os = "macos", not(target_arch = "aarch64")))]
17081708
pub fn remove_dir_all(p: &Path) -> io::Result<()> {
17091709
if macos_weak::has_openat() {
17101710
// openat() is available with macOS 10.10+, just like unlinkat() and fdopendir()

0 commit comments

Comments
 (0)