Skip to content

Commit 5eb88fa

Browse files
committed
hide unused exports on other platforms
1 parent 1623647 commit 5eb88fa

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

library/std/src/io/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,8 @@ pub use self::stdio::{set_panic, set_print};
283283
#[stable(feature = "rust1", since = "1.0.0")]
284284
pub use self::util::{empty, repeat, sink, Empty, Repeat, Sink};
285285

286-
pub(crate) use self::copy::generic_copy;
287-
288286
mod buffered;
289-
mod copy;
287+
pub(crate) mod copy;
290288
mod cursor;
291289
mod error;
292290
mod impls;

library/std/src/io/stdio.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,8 @@ impl Read for Stdin {
409409
}
410410
}
411411

412+
// only used by platform-dependent io::copy specializations, i.e. unused on some platforms
413+
#[cfg(any(target_os = "linux", target_os = "android"))]
412414
impl StdinLock<'_> {
413415
pub(crate) fn as_mut_buf(&mut self) -> &mut BufReader<impl Read> {
414416
&mut self.inner

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,7 @@ pub(crate) fn copy_regular_files(
12761276
// - copy_file_range is disallowed, for example by seccomp (EPERM)
12771277
// - copy_file_range cannot be used with pipes or device nodes (EINVAL)
12781278
assert_eq!(written, 0);
1279-
return io::generic_copy(reader, writer);
1279+
return io::copy::generic_copy(reader, writer);
12801280
}
12811281
_ => return Err(err),
12821282
}
@@ -1328,7 +1328,7 @@ pub(crate) fn sendfile_splice(
13281328
// Try fallback io::copy if splice/sendfile do not support this particular
13291329
// file descritor (EINVAL)
13301330
assert_eq!(written, 0);
1331-
return io::generic_copy(reader, writer);
1331+
return io::copy::generic_copy(reader, writer);
13321332
}
13331333
_ => return Err(err),
13341334
}

0 commit comments

Comments
 (0)