-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Custom Debug impl for io::Error #26416
Conversation
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
👍 |
+1 from me as well, definitely addresses the concerns from #26408 |
It may be a bit nicer to look at if we output |
Fixes rust-lang#26408 Signed-off-by: Peter Atashian <[email protected]>
Agreed. I like the setup in the latest commit. |
Test please. |
Signed-off-by: Peter Atashian <[email protected]>
@arielb1 Test added |
@bors r+ |
📌 Commit c8aec53 has been approved by |
⌛ Testing commit c8aec53 with merge 8ca4351... |
💔 Test failed - auto-linux-32-opt |
@bors retry |
⌛ Testing commit c8aec53 with merge b53c6cc... |
💔 Test failed - auto-win-gnu-64-opt |
shakes fist at spurious failures |
@bors retry |
Fixes #26408 Example output when using `Result::unwrap`: ``` thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 2, message: "The system cannot find the file specified.\r\n" } }', src/libcore\result.rs:731 ``` This could technically be considered a breaking change for any code that depends on the format of the `Debug` output for `io::Error` but I sincerely hope nobody wrote code like that.
/me cant believe that we still havent solved the problem of including the requested path in the error information here (for the specific example of "no such file or directory") |
@pnkfelix That would involve storing the requested path in the |
why I still got this error when I run the code from Mac 10.13.6 with rustc version 1.29.0. |
Fixes #26408
Example output when using
Result::unwrap
:This could technically be considered a breaking change for any code that depends on the format of the
Debug
output forio::Error
but I sincerely hope nobody wrote code like that.