-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #6416 - deg4uss3r:map_err_restricted, r=ebroto
Moved map_err_ignore to restriction and updated help message This MR moves map_err_ignore lint from `pedantic` to the `restriction` category of lints and updates the help message to give the user an option to ignore the lint by naming the closure variable e.g. `.map_err(|_ignored| ...` --- changelog: move map_err_ignore to restriction category
- Loading branch information
Showing
4 changed files
with
10 additions
and
6 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
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,11 +1,11 @@ | ||
error: `map_err(|_|...` ignores the original error | ||
error: `map_err(|_|...` wildcard pattern discards the original error | ||
--> $DIR/map_err.rs:23:32 | ||
| | ||
LL | println!("{:?}", x.map_err(|_| Errors::Ignored)); | ||
| ^^^ | ||
| | ||
= note: `-D clippy::map-err-ignore` implied by `-D warnings` | ||
= help: Consider wrapping the error in an enum variant | ||
= help: Consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`) | ||
|
||
error: aborting due to previous error | ||
|