Skip to content

Commit

Permalink
Rollup merge of rust-lang#102781 - StackOverflowExcept1on:master, r=j…
Browse files Browse the repository at this point in the history
…oshtriplett

Improved documentation for `std::io::Error`
  • Loading branch information
matthiaskrgr authored Oct 14, 2022
2 parents 57f8be0 + f95e853 commit 3966066
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/std/src/io/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ impl Error {
/// originate from the OS itself. The `error` argument is an arbitrary
/// payload which will be contained in this [`Error`].
///
/// Note that this function allocates memory on the heap.
/// If no extra payload is required, use the `From` conversion from
/// `ErrorKind`.
///
Expand All @@ -495,7 +496,7 @@ impl Error {
/// // errors can also be created from other errors
/// let custom_error2 = Error::new(ErrorKind::Interrupted, custom_error);
///
/// // creating an error without payload
/// // creating an error without payload (and without memory allocation)
/// let eof_error = Error::from(ErrorKind::UnexpectedEof);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down

0 comments on commit 3966066

Please sign in to comment.