-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std: Stablize io::ErrorKind #23430
std: Stablize io::ErrorKind #23430
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
r? @aturon |
Hm, stability hack: we could stop exhaustive matching in stable code by including an enum ErrorKind {
...
#[stable]
Other
#[unstable]
Nonexhaustive
} Thoughts? |
@huonw That's not a bad idea, but it's also very difficult to imagine anyone exhaustively matching in practice, so I'm also ok just waiting for extensible enums. @alexcrichton Do you want to add a comment saying that the set of kinds can grow over time? Otherwise r=me |
Hm, that's not a bad idea. I wouldn't want the unstable variant to exist until the end of time, but we may get extensible enums at some point in the future which would obsolete the need for the variant, so I'd be comfortable with that. |
I ended up adding a |
@bors: r=aturon 11ec674 |
⌛ Testing commit 11ec674 with merge c3760e7... |
💔 Test failed - auto-mac-64-nopt-t |
@bors: r=aturon |
📌 Commit 8835ea9 has been approved by |
@bors: p=1 (not included in rollup (accident), might as well prioritize it over the other rolled up PRs) |
⌛ Testing commit 8835ea9 with merge a82a9fd... |
💔 Test failed - auto-win-64-opt |
This commit stabilizes the `ErrorKind` enumeration which is consumed by and generated by the `io::Error` type. The purpose of this type is to serve as a cross-platform namespace to categorize errors into. Two specific issues are addressed as part of this stablization: * The naming of each variant was scrutinized and some were tweaked. An example is how `FileNotFound` was renamed to simply `NotFound`. These names should not show either a Unix or Windows bias and the set of names is intended to grow over time. For now the names will likely largely consist of those errors generated by the I/O APIs in the standard library. * The mapping of OS error codes onto kinds has been altered. Coalescing no longer occurs (multiple error codes become one kind). It is intended that each OS error code, if bound, corresponds to only one `ErrorKind`. The current set of error kinds was expanded slightly to include some networking errors. This commit also adds a `raw_os_error` function which returns an `Option<i32>` to extract the underlying raw error code from the `Error`.
⌛ Testing commit dedac5e with merge 7f53b94... |
This commit stabilizes the `ErrorKind` enumeration which is consumed by and generated by the `io::Error` type. The purpose of this type is to serve as a cross-platform namespace to categorize errors into. Two specific issues are addressed as part of this stablization: * The naming of each variant was scrutinized and some were tweaked. An example is how `FileNotFound` was renamed to simply `NotFound`. These names should not show either a Unix or Windows bias and the set of names is intended to grow over time. For now the names will likely largely consist of those errors generated by the I/O APIs in the standard library. * The mapping of OS error codes onto kinds has been altered. Coalescing no longer occurs (multiple error codes become one kind). It is intended that each OS error code, if bound, corresponds to only one `ErrorKind`. The current set of error kinds was expanded slightly to include some networking errors. This commit also adds a `raw_os_error` function which returns an `Option<i32>` to extract the underlying raw error code from the `Error`. Closes #16666 [breaking-change]
Reintroduces use of unstable features, though a number of them are stabilized in fix rust-lang/rust#23430
This commit stabilizes the
ErrorKind
enumeration which is consumed by andgenerated by the
io::Error
type. The purpose of this type is to serve as across-platform namespace to categorize errors into. Two specific issues are
addressed as part of this stablization:
is how
FileNotFound
was renamed to simplyNotFound
. These names should notshow either a Unix or Windows bias and the set of names is intended to grow
over time. For now the names will likely largely consist of those errors
generated by the I/O APIs in the standard library.
longer occurs (multiple error codes become one kind). It is intended that each
OS error code, if bound, corresponds to only one
ErrorKind
. The current setof error kinds was expanded slightly to include some networking errors.
This commit also adds a
raw_os_error
function which returns anOption<i32>
to extract the underlying raw error code from the
Error
.Closes #16666
[breaking-change]