-
Notifications
You must be signed in to change notification settings - Fork 13.4k
impl Display for io::ErrorKind
#93090
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
FYI @pietroalbini I still seem to have various github permissions even after leaving the rustdoc team, you might want into look into the automation for that. |
library/std/src/io/error.rs
Outdated
impl fmt::Display for ErrorKind { | ||
/// Shows a human-readable description of the `ErrorKind`. | ||
/// | ||
/// This is similar to `impl Display for Error`, but doesn't require the error to be allocated on the heap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized after writing this that the comment is wrong and this impl is less useful than I thought, because impl From<ErrorKind> for Error
doesn't allocate. But this still seems like a useful change even so to avoid noise.
This avoids having to convert from `ErrorKind` to `Error` just to print the error message.
c9f1afe
to
f8ee57b
Compare
This seems reasonable to me. @rfcbot merge |
Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Aside: This makes me wonder if it might make sense to implement |
@ChrisDenton That seems like a great idea, and it might substantially simplify error handling code that needs to check for specific cases. |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
@bors r+ |
📌 Commit f8ee57b has been approved by |
`impl Display for io::ErrorKind` This avoids having to convert from `ErrorKind` to `Error` just to print the error message.
`impl Display for io::ErrorKind` This avoids having to convert from `ErrorKind` to `Error` just to print the error message.
Rollup of 9 pull requests Successful merges: - rust-lang#91343 (Fix suggestion to slice if scrutinee is a `Result` or `Option`) - rust-lang#93019 (If an integer is entered with an upper-case base prefix (0Xbeef, 0O755, 0B1010), suggest to make it lowercase) - rust-lang#93090 (`impl Display for io::ErrorKind`) - rust-lang#93456 (Remove an unnecessary transmute from opaque::Encoder) - rust-lang#93492 (Hide failed command unless in verbose mode) - rust-lang#93504 (kmc-solid: Increase the default stack size) - rust-lang#93513 (Allow any pretty printed line to have at least 60 chars) - rust-lang#93532 (Update books) - rust-lang#93533 (Update cargo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This avoids having to convert from
ErrorKind
toError
just to print the error message.