Skip to content

Commit 365e00a

Browse files
committed
remove ReadDir.end_of_stream on targets that don't use it
1 parent c1297ec commit 365e00a

File tree

1 file changed

+18
-1
lines changed
  • library/std/src/sys/unix

1 file changed

+18
-1
lines changed

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

+18-1
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ struct InnerReadDir {
185185

186186
pub struct ReadDir {
187187
inner: Arc<InnerReadDir>,
188+
#[cfg(not(any(
189+
target_os = "solaris",
190+
target_os = "illumos",
191+
target_os = "fuchsia",
192+
target_os = "redox",
193+
)))]
188194
end_of_stream: bool,
189195
}
190196

@@ -943,7 +949,18 @@ pub fn readdir(p: &Path) -> io::Result<ReadDir> {
943949
Err(Error::last_os_error())
944950
} else {
945951
let inner = InnerReadDir { dirp: Dir(ptr), root };
946-
Ok(ReadDir { inner: Arc::new(inner), end_of_stream: false })
952+
cfg_if::cfg_if! {
953+
if #[cfg(not(any(
954+
target_os = "solaris",
955+
target_os = "illumos",
956+
target_os = "fuchsia",
957+
target_os = "redox",
958+
)))] {
959+
Ok(ReadDir { inner: Arc::new(inner), end_of_stream: false })
960+
} else {
961+
Ok(ReadDir { inner: Arc::new(inner) })
962+
}
963+
}
947964
}
948965
}
949966
}

0 commit comments

Comments
 (0)