about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2020-12-03 20:13:51 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2020-12-04 18:38:44 +0000
commitdb5d697004d8bf3ce783d02f2e4a1c8354281d78 (patch)
treee9ad01e6d6cce60334113e57c6b80a7225cde775
parentc4926d01ada661d4fbffb0e5b1708ae5463d47b3 (diff)
downloadrust-db5d697004d8bf3ce783d02f2e4a1c8354281d78.tar.gz
rust-db5d697004d8bf3ce783d02f2e4a1c8354281d78.zip
std: impl of `Write` for `&mut [u8]`: document the buffer full error
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r--library/std/src/io/impls.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/io/impls.rs b/library/std/src/io/impls.rs
index 6b3c86cb0df..00bf8b9af73 100644
--- a/library/std/src/io/impls.rs
+++ b/library/std/src/io/impls.rs
@@ -306,6 +306,10 @@ impl BufRead for &[u8] {
 ///
 /// Note that writing updates the slice to point to the yet unwritten part.
 /// The slice will be empty when it has been completely overwritten.
+///
+/// If the number of bytes to be written exceeds the size of the slice, write operations will
+/// return short writes: ultimately, `Ok(0)`; in this situation, `write_all` returns an error of
+/// kind `ErrorKind::WriteZero`.
 #[stable(feature = "rust1", since = "1.0.0")]
 impl Write for &mut [u8] {
     #[inline]