Rollup merge of #100296 - BlackHoleFox:os-error-aliases, r=thomcc
Add standard C error function aliases to last_os_error This aids the discoverability of `io::Error::last_os_error()` by linking to commonly used error number functions from C/C++. I've seen a few people not realize this exists, so hopefully this helps draw attention to the API to encourage using it over integer error codes.
This commit is contained in:
commit
58174e3f7c
@ -573,6 +573,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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user