diff options
| author | The8472 <git@infinite-source.de> | 2020-08-08 01:30:03 +0200 |
|---|---|---|
| committer | The8472 <git@infinite-source.de> | 2020-11-13 19:45:38 +0100 |
| commit | 5eb88fa5c72d0f9b5abe106881f2c5ffba9b073d (patch) | |
| tree | ad62ac7aacbaaaada42cc164bd392d5fbd59d6b2 | |
| parent | 16236470c1774f88374bab29d2b9d1875cb97246 (diff) | |
| download | rust-5eb88fa5c72d0f9b5abe106881f2c5ffba9b073d.tar.gz rust-5eb88fa5c72d0f9b5abe106881f2c5ffba9b073d.zip | |
hide unused exports on other platforms
| -rw-r--r-- | library/std/src/io/mod.rs | 4 | ||||
| -rw-r--r-- | library/std/src/io/stdio.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/unix/fs.rs | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index 0529b42347e..cc0e1172a53 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -283,10 +283,8 @@ pub use self::stdio::{set_panic, set_print}; #[stable(feature = "rust1", since = "1.0.0")] pub use self::util::{empty, repeat, sink, Empty, Repeat, Sink}; -pub(crate) use self::copy::generic_copy; - mod buffered; -mod copy; +pub(crate) mod copy; mod cursor; mod error; mod impls; diff --git a/library/std/src/io/stdio.rs b/library/std/src/io/stdio.rs index 47ff13f5298..8a69e9ccd55 100644 --- a/library/std/src/io/stdio.rs +++ b/library/std/src/io/stdio.rs @@ -409,6 +409,8 @@ impl Read for Stdin { } } +// only used by platform-dependent io::copy specializations, i.e. unused on some platforms +#[cfg(any(target_os = "linux", target_os = "android"))] impl StdinLock<'_> { pub(crate) fn as_mut_buf(&mut self) -> &mut BufReader<impl Read> { &mut self.inner diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs index 012e4a16b9f..b106eb0a5b6 100644 --- a/library/std/src/sys/unix/fs.rs +++ b/library/std/src/sys/unix/fs.rs @@ -1276,7 +1276,7 @@ pub(crate) fn copy_regular_files( // - copy_file_range is disallowed, for example by seccomp (EPERM) // - copy_file_range cannot be used with pipes or device nodes (EINVAL) assert_eq!(written, 0); - return io::generic_copy(reader, writer); + return io::copy::generic_copy(reader, writer); } _ => return Err(err), } @@ -1328,7 +1328,7 @@ pub(crate) fn sendfile_splice( // Try fallback io::copy if splice/sendfile do not support this particular // file descritor (EINVAL) assert_eq!(written, 0); - return io::generic_copy(reader, writer); + return io::copy::generic_copy(reader, writer); } _ => return Err(err), } |
