Commit 06112ab
committed
Rollup merge of rust-lang#47120 - clarcharr:io_error_debug, r=dtolnay
Better Debug impl for io::Error.
This PR includes the below changes:
1. The former impl wrapped the entire thing in `Error { repr: ... }` which was unhelpful; this has been removed.
2. The `Os` variant of `io::Error` included the code and message, but not the kind; this has been fixed.
3. The `Custom` variant of `io::Error` included a `Custom(Custom { ... })`, which is now just `Custom { ... }`.
Example of previous impl:
```rust
Error {
repr: Custom(
Custom {
kind: InvalidData,
error: Error {
repr: Os {
code: 2,
message: "no such file or directory"
}
}
}
)
}
```
Example of new impl:
```rust
Custom {
kind: InvalidData,
error: Os {
code: 2,
kind: NotFound,
message: "no such file or directory"
}
}
```1 file changed
+35
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| |||
511 | 517 | | |
512 | 518 | | |
513 | 519 | | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
518 | 526 | | |
519 | 527 | | |
520 | 528 | | |
| |||
559 | 567 | | |
560 | 568 | | |
561 | 569 | | |
562 | | - | |
| 570 | + | |
563 | 571 | | |
564 | 572 | | |
565 | 573 | | |
| 574 | + | |
566 | 575 | | |
567 | 576 | | |
568 | 577 | | |
569 | 578 | | |
570 | 579 | | |
571 | | - | |
572 | | - | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
573 | 600 | | |
574 | 601 | | |
575 | 602 | | |
| |||
0 commit comments