Skip to content

Commit f1ff3c1

Browse files
committed
Soft deprecate Sink
Signed-off-by: Alex Saveau <[email protected]>
1 parent 11467b1 commit f1ff3c1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

library/std/src/io/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ pub use self::stdio::IsTerminal;
273273
#[unstable(feature = "print_internals", issue = "none")]
274274
pub use self::stdio::{_eprint, _print};
275275
#[stable(feature = "rust1", since = "1.0.0")]
276+
#[allow(deprecated_in_future)]
276277
pub use self::{
277278
buffered::{BufReader, BufWriter, IntoInnerError, LineWriter},
278279
copy::copy,

library/std/src/io/util.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ impl fmt::Debug for Repeat {
245245
#[stable(feature = "rust1", since = "1.0.0")]
246246
#[non_exhaustive]
247247
#[derive(Copy, Clone, Debug, Default)]
248+
#[deprecated(since = "TBD", note = "superseded by `Empty`")]
248249
pub struct Sink;
249250

250251
/// Creates an instance of a writer which will successfully consume all data.
@@ -267,11 +268,14 @@ pub struct Sink;
267268
#[must_use]
268269
#[stable(feature = "rust1", since = "1.0.0")]
269270
#[rustc_const_unstable(feature = "const_io_structs", issue = "78812")]
271+
#[deprecated(since = "TBD", note = "superseded by `Empty`")]
272+
#[allow(deprecated_in_future)]
270273
pub const fn sink() -> Sink {
271274
Sink
272275
}
273276

274277
#[stable(feature = "rust1", since = "1.0.0")]
278+
#[allow(deprecated_in_future)]
275279
impl Write for Sink {
276280
#[inline]
277281
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
@@ -296,6 +300,7 @@ impl Write for Sink {
296300
}
297301

298302
#[stable(feature = "write_mt", since = "1.48.0")]
303+
#[allow(deprecated_in_future)]
299304
impl Write for &Sink {
300305
#[inline]
301306
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {

0 commit comments

Comments
 (0)