Add standard C error function aliases

Aids the discoverability of `io::Error::last_os_error()` by linking to
commonly used error number functions from C/C++.
This commit is contained in:
BlackHoleFox 2022-08-08 17:49:19 -07:00
parent f03ce30962
commit 08c97323de

View File

@ -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 {