Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion library/std/src/io/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,18 @@ impl Error {
/// `GetLastError` on Windows) and will return a corresponding instance of
/// [`Error`] for the error code.
///
/// This should be called immediately after a call to a platform function,
/// otherwise the state of the error value is indeterminate. In particular,
/// other standard library functions may call platform functions that may
/// (or may not) reset the error value even if they succeed.
///
/// # Examples
///
/// ```
/// use std::io::Error;
///
/// println!("last OS error: {:?}", Error::last_os_error());
/// let os_error = Error::last_os_error();
/// println!("last OS error: {:?}", os_error);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[must_use]
Expand Down