Add a comment to Read::read_buf · qinheping/verify-rust-std@57557c9 (original) (raw)

Original file line number Diff line number Diff line change
@@ -978,6 +978,8 @@ pub trait Read {
978 978 /// with uninitialized buffers. The new data will be appended to any existing contents of `buf`.
979 979 ///
980 980 /// The default implementation delegates to `read`.
981 + ///
982 + /// This method makes it possible to return both data and an error but it is advised against.
981 983 #[unstable(feature = "read_buf", issue = "78485")]
982 984 fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<()> {
983 985 default_read_buf(|b