Skip to content

Commit

Permalink
Use unspecified over undefined in io::Write::write_all_vectored docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasdezeeuw committed Apr 1, 2020
1 parent 33a4999 commit 9745b1f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/libstd/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1388,19 +1388,21 @@ pub trait Write {
///
/// If the buffer contains no data, this will never call [`write_vectored`].
///
/// [`write_vectored`]: #tymethod.write_vectored
/// [`ErrorKind::Interrupted`]: ../../std/io/enum.ErrorKind.html#variant.Interrupted
///
/// # Notes
///
/// Different to `io::Write::write_vectored` this takes a *mutable*
/// reference to a slice of `IoSlice`s, not a non-mutable reference, because
/// we need to modify the slice to keep track of the bytes already written.
///
/// Once this function returns the contents of `bufs` is undefined, not
/// undefined as in memory unsafe but we don't know what the contents of
/// `bufs` will be as that depends on how many writes we needed to do. We
/// advice to see this function as taking ownership of `bufs` and don't use
/// the variable after the future returns. The underlying buffers, to which
/// `IoSlice` points (not the `IoSlice` itself), are unchanged and can be
/// reused.
/// Once this function returns the contents of `bufs` is unspecified, as we
/// don't know what the contents of `bufs` will be as that depends on how
/// many writes we needed to do. We advice to see this function as taking
/// ownership of `bufs` and don't use the variable after the future returns.
/// The underlying buffers, to which `IoSlice` points (not the `IoSlice`
/// itself), are unchanged and can be reused.
///
/// # Examples
///
Expand Down

0 comments on commit 9745b1f

Please sign in to comment.