Skip to content

Commit

Permalink
Add standard C error function aliases
Browse files Browse the repository at this point in the history
Aids the discoverability of `io::Error::last_os_error()` by linking to
commonly used error number functions from C/C++.
  • Loading branch information
BlackHoleFox committed Aug 9, 2022
1 parent f03ce30 commit 08c9732
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/std/src/io/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,8 @@ impl Error {
/// println!("last OS error: {os_error:?}");
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(alias = "GetLastError")]
#[doc(alias = "errno")]
#[must_use]
#[inline]
pub fn last_os_error() -> Error {
Expand Down

0 comments on commit 08c9732

Please sign in to comment.