File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -481,6 +481,7 @@ impl Error {
481481 /// originate from the OS itself. The `error` argument is an arbitrary
482482 /// payload which will be contained in this [`Error`].
483483 ///
484+ /// Note that this function allocates memory on the heap.
484485 /// If no extra payload is required, use the `From` conversion from
485486 /// `ErrorKind`.
486487 ///
@@ -495,7 +496,7 @@ impl Error {
495496 /// // errors can also be created from other errors
496497 /// let custom_error2 = Error::new(ErrorKind::Interrupted, custom_error);
497498 ///
498- /// // creating an error without payload
499+ /// // creating an error without payload (and without memory allocation)
499500 /// let eof_error = Error::from(ErrorKind::UnexpectedEof);
500501 /// ```
501502 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
You can’t perform that action at this time.
0 commit comments