diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 6f3649c8320..43a26292618 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -433,15 +433,19 @@ fn read(&mut self, buf: &mut [u8]) -> io::Result { /// infrequent calls to `read` and `write` on the underlying `Read+Write`. /// /// The output buffer will be written out when this stream is dropped. -#[stable(feature = "rust1", since = "1.0.0")] +#[unstable(feature = "buf_stream", + reason = "unsure about semantics of buffering two directions, \ + leading to issues like #17136")] pub struct BufStream { inner: BufReader> } +#[unstable(feature = "buf_stream", + reason = "unsure about semantics of buffering two directions, \ + leading to issues like #17136")] impl BufStream { /// Creates a new buffered stream with explicitly listed capacities for the /// reader/writer buffer. - #[stable(feature = "rust1", since = "1.0.0")] pub fn with_capacities(reader_cap: usize, writer_cap: usize, inner: S) -> BufStream { let writer = BufWriter::with_capacity(writer_cap, inner); @@ -452,13 +456,11 @@ pub fn with_capacities(reader_cap: usize, writer_cap: usize, inner: S) /// Creates a new buffered stream with the default reader/writer buffer /// capacities. - #[stable(feature = "rust1", since = "1.0.0")] pub fn new(inner: S) -> BufStream { BufStream::with_capacities(DEFAULT_BUF_SIZE, DEFAULT_BUF_SIZE, inner) } /// Gets a reference to the underlying stream. - #[stable(feature = "rust1", since = "1.0.0")] pub fn get_ref(&self) -> &S { let InternalBufWriter(ref w) = self.inner.inner; w.get_ref() @@ -470,7 +472,6 @@ pub fn get_ref(&self) -> &S { /// /// It is inadvisable to read directly from or write directly to the /// underlying stream. - #[stable(feature = "rust1", since = "1.0.0")] pub fn get_mut(&mut self) -> &mut S { let InternalBufWriter(ref mut w) = self.inner.inner; w.get_mut() @@ -480,7 +481,6 @@ pub fn get_mut(&mut self) -> &mut S { /// /// The internal write buffer is written out before returning the stream. /// Any leftover data in the read buffer is lost. - #[stable(feature = "rust1", since = "1.0.0")] pub fn into_inner(self) -> Result>> { let BufReader { inner: InternalBufWriter(w), buf, pos, cap } = self.inner; w.into_inner().map_err(|IntoInnerError(w, e)| { @@ -491,20 +491,26 @@ pub fn into_inner(self) -> Result>> { } } -#[stable(feature = "rust1", since = "1.0.0")] +#[unstable(feature = "buf_stream", + reason = "unsure about semantics of buffering two directions, \ + leading to issues like #17136")] impl BufRead for BufStream { fn fill_buf(&mut self) -> io::Result<&[u8]> { self.inner.fill_buf() } fn consume(&mut self, amt: usize) { self.inner.consume(amt) } } -#[stable(feature = "rust1", since = "1.0.0")] +#[unstable(feature = "buf_stream", + reason = "unsure about semantics of buffering two directions, \ + leading to issues like #17136")] impl Read for BufStream { fn read(&mut self, buf: &mut [u8]) -> io::Result { self.inner.read(buf) } } -#[stable(feature = "rust1", since = "1.0.0")] +#[unstable(feature = "buf_stream", + reason = "unsure about semantics of buffering two directions, \ + leading to issues like #17136")] impl Write for BufStream { fn write(&mut self, buf: &[u8]) -> io::Result { self.inner.inner.get_mut().write(buf) @@ -514,7 +520,9 @@ fn flush(&mut self) -> io::Result<()> { } } -#[stable(feature = "rust1", since = "1.0.0")] +#[unstable(feature = "buf_stream", + reason = "unsure about semantics of buffering two directions, \ + leading to issues like #17136")] impl fmt::Debug for BufStream where S: fmt::Debug { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { let reader = &self.inner;