forked from rust-lang/rust
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed map_err suggestion in lint, and updated lint documentation ex…
…ample
- Loading branch information
Ricky
authored and
Ricky
committed
Sep 2, 2020
1 parent
3377291
commit 2387f68
Showing
2 changed files
with
60 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
error: `map_err` has thrown away the original error | ||
error: `map_else(|_|...` ignores the original error | ||
--> $DIR/map_err.rs:21:32 | ||
| | ||
LL | println!("{:?}", x.map_err(|_| Errors::Ignored)); | ||
| ^^^ help: Allow the error enum to encapsulate the original error: `|e| Errors::Ignored(e)` | ||
| ^^^ | ||
| | ||
= note: `-D clippy::map-err-ignore` implied by `-D warnings` | ||
= help: Consider wrapping the error in an enum variant | ||
|
||
error: aborting due to previous error | ||
|