Rollup merge of #102781 - StackOverflowExcept1on:master, r=joshtriplett
Improved documentation for `std::io::Error`
This commit is contained in:
commit
fbb0c31544
1 changed files with 2 additions and 1 deletions
|
@ -481,6 +481,7 @@ impl Error {
|
||||||
/// originate from the OS itself. The `error` argument is an arbitrary
|
/// originate from the OS itself. The `error` argument is an arbitrary
|
||||||
/// payload which will be contained in this [`Error`].
|
/// 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
|
/// If no extra payload is required, use the `From` conversion from
|
||||||
/// `ErrorKind`.
|
/// `ErrorKind`.
|
||||||
///
|
///
|
||||||
|
@ -495,7 +496,7 @@ impl Error {
|
||||||
/// // errors can also be created from other errors
|
/// // errors can also be created from other errors
|
||||||
/// let custom_error2 = Error::new(ErrorKind::Interrupted, custom_error);
|
/// 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);
|
/// let eof_error = Error::from(ErrorKind::UnexpectedEof);
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue