summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/process/chdir.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/rustix/src/process/chdir.rs')
-rw-r--r--vendor/rustix/src/process/chdir.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/vendor/rustix/src/process/chdir.rs b/vendor/rustix/src/process/chdir.rs
index 0da0b5c2e..b110afef8 100644
--- a/vendor/rustix/src/process/chdir.rs
+++ b/vendor/rustix/src/process/chdir.rs
@@ -1,11 +1,13 @@
#[cfg(not(target_os = "fuchsia"))]
use crate::backend::fd::AsFd;
+#[cfg(feature = "fs")]
+use crate::path;
#[cfg(any(feature = "fs", not(target_os = "fuchsia")))]
use crate::{backend, io};
-#[cfg(feature = "fs")]
+#[cfg(all(feature = "alloc", feature = "fs"))]
use {
crate::ffi::{CStr, CString},
- crate::path::{self, SMALL_PATH_BUFFER_SIZE},
+ crate::path::SMALL_PATH_BUFFER_SIZE,
alloc::vec::Vec,
};
@@ -48,7 +50,7 @@ pub fn fchdir<Fd: AsFd>(fd: Fd) -> io::Result<()> {
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html
/// [Linux]: https://man7.org/linux/man-pages/man3/getcwd.3.html
-#[cfg(feature = "fs")]
+#[cfg(all(feature = "alloc", feature = "fs"))]
#[cfg(not(target_os = "wasi"))]
#[cfg_attr(doc_cfg, doc(cfg(feature = "fs")))]
#[inline]
@@ -56,7 +58,7 @@ pub fn getcwd<B: Into<Vec<u8>>>(reuse: B) -> io::Result<CString> {
_getcwd(reuse.into())
}
-#[cfg(feature = "fs")]
+#[cfg(all(feature = "alloc", feature = "fs"))]
#[allow(unsafe_code)]
fn _getcwd(mut buffer: Vec<u8>) -> io::Result<CString> {
buffer.clear();