-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
Add other variants to std::io::ErrorKind enum #64314
Comments
The docs do say "This list is intended to grow over time and it is not recommended to exhaustively match against it." currently (and we enforce non exhaustive matching via an attribute); I think our hands technically aren't tied here but we'll want to be very cautious. @rust-lang/libs -- does anyone have thoughts on growing To address your specific concern, you can use |
I agree that it's been so long since we've added one that we should probably do so carefully (aka use crater) but I think in general it's fine to add more. |
The enum has |
Is this something I can reasonably tackle as a first contribution? |
Add variants sounds fine, but when would |
@SimonSapin I think one case where it can happen is when you try a filesystem operation on |
I was trying to rewrite Python code in Rust and I need to match against what could be
NotADirectory
(ENOTDIR
) and saw thatErrorKind
's variants do not include manyerrno
s present inlibc
- to speak only of the Unix platform - including the one I need.Is there a reason why those variants were not implemented? Could this be my first contribution to Rust?
The text was updated successfully, but these errors were encountered: