about summary refs log tree commit diff
path: root/library/std/src/sys/unix
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2020-10-09 09:59:39 -0700
committerJosh Stone <jistone@redhat.com>2020-10-09 10:00:11 -0700
commit365e00aeeee4c84e29a2fdbee18faa69edcae2ee (patch)
tree7d03879a727be06116322d355677021197eb48cc /library/std/src/sys/unix
parentc1297eca3ebd899f0329892542af40a211300115 (diff)
downloadrust-365e00aeeee4c84e29a2fdbee18faa69edcae2ee.tar.gz
rust-365e00aeeee4c84e29a2fdbee18faa69edcae2ee.zip
remove ReadDir.end_of_stream on targets that don't use it
Diffstat (limited to 'library/std/src/sys/unix')
-rw-r--r--library/std/src/sys/unix/fs.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs
index 9e37108c887..2c7a7e55d0e 100644
--- a/library/std/src/sys/unix/fs.rs
+++ b/library/std/src/sys/unix/fs.rs
@@ -185,6 +185,12 @@ struct InnerReadDir {
 
 pub struct ReadDir {
     inner: Arc<InnerReadDir>,
+    #[cfg(not(any(
+        target_os = "solaris",
+        target_os = "illumos",
+        target_os = "fuchsia",
+        target_os = "redox",
+    )))]
     end_of_stream: bool,
 }
 
@@ -943,7 +949,18 @@ pub fn readdir(p: &Path) -> io::Result<ReadDir> {
             Err(Error::last_os_error())
         } else {
             let inner = InnerReadDir { dirp: Dir(ptr), root };
-            Ok(ReadDir { inner: Arc::new(inner), end_of_stream: false })
+            cfg_if::cfg_if! {
+                if #[cfg(not(any(
+                    target_os = "solaris",
+                    target_os = "illumos",
+                    target_os = "fuchsia",
+                    target_os = "redox",
+                )))] {
+                    Ok(ReadDir { inner: Arc::new(inner), end_of_stream: false })
+                } else {
+                    Ok(ReadDir { inner: Arc::new(inner) })
+                }
+            }
         }
     }
 }