| Age | Commit message (Collapse) | Author | Lines |
|
|
|
- Hide Docs
- Use repr_unpacked error
Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
|
|
|
|
Stabilize `io_error_other` feature
Per the FCP for https://github.com/rust-lang/rust/issues/91946.
|
|
Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
|
|
|
|
|
|
|
|
workingjubilee:crouching-ioerror-hidden-documentation, r=ChrisDenton
Clarify `Error::last_os_error` can be weird
Fundamentally, querying the OS for error codes is a process that is deeply subject to the whims of chance and fortune. We can account for OS, but not for every combination of platform APIs. A compiled binary may not recognize new errors introduced years later. We should clarify a few especially odd situations, and what they mean: We can effectively promise nothing... if you ask for Rust to decode errors where none have occurred.
This allows removing mention of ErrorKind::Uncategorized.
That error variant is hidden deliberately, so we should not explicitly mention it.
This fixes #106937.
Since you had an opinion also: Does this solution seem acceptable?
r? ``@ChrisDenton``
|
|
|
|
|
|
Implement rust-lang/libs-team#173.
|
|
Fundamentally, querying the OS for error codes is a process
that is deeply subject to the whims of chance and fortune.
We can account for OS, but not for every combination of platform APIs.
A compiled binary may not recognize new errors introduced years later.
We should clarify a few especially odd situations, and what they mean:
We can effectively promise nothing.
This allows removing mention of ErrorKind::Uncategorized.
That error variant is hidden quite deliberately, so we
should not explicitly mention it.
|
|
More alphabetical sorting
Sort and enforce a few more things. The biggest change here is sorting all target features.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
Aids the discoverability of `io::Error::last_os_error()` by linking to
commonly used error number functions from C/C++.
|
|
|
|
Co-authored-by: Jane Losare-Lusby <jlusby42@gmail.com>
|
|
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
|
|
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
|
|
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
|
|
This updates the standard library's documentation to use the new syntax. The
documentation is worthwhile to update as it should be more idiomatic
(particularly for features like this, which are nice for users to get acquainted
with). The general codebase is likely more hassle than benefit to update: it'll
hurt git blame, and generally updates can be done by folks updating the code if
(and when) that makes things more readable with the new format.
A few places in the compiler and library code are updated (mostly just due to
already having been done when this commit was first authored).
|
|
|
|
|
|
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
|
|
|
|
quite accurate anymore
|
|
|
|
|
|
|
|
|
|
|
|
This avoids having to convert from `ErrorKind` to `Error` just to print the error message.
|
|
|
|
|
|
This conversion is not very discoverable for the cases
where an error is required without extra payload.
|
|
|
|
r=joshtriplett
Add #[must_use] to from_value conversions
I added two methods to the list myself. Clippy did not flag them because they take `mut` args, but neither modifies their argument.
```rust
core::str const unsafe fn from_utf8_unchecked_mut(v: &mut [u8]) -> &mut str;
std::ffi::CString unsafe fn from_raw(ptr: *mut c_char) -> CString;
```
I put a custom note on `from_raw`:
```rust
#[must_use = "call `drop(from_raw(ptr))` if you intend to drop the `CString`"]
pub unsafe fn from_raw(ptr: *mut c_char) -> CString {
```
Parent issue: #89692
r? ``@joshtriplett``
|
|
|
|
|