Skip to content

Commit

Permalink
Move map_err_ignore from style to pedantic
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricky authored and Ricky committed Sep 8, 2020
1 parent 4f1c4a9 commit d719b48
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&loops::EXPLICIT_INTO_ITER_LOOP),
LintId::of(&loops::EXPLICIT_ITER_LOOP),
LintId::of(&macro_use::MACRO_USE_IMPORTS),
LintId::of(&map_err_ignore::MAP_ERR_IGNORE),
LintId::of(&match_on_vec_items::MATCH_ON_VEC_ITEMS),
LintId::of(&matches::MATCH_BOOL),
LintId::of(&matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS),
Expand Down Expand Up @@ -1330,7 +1331,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&manual_async_fn::MANUAL_ASYNC_FN),
LintId::of(&manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE),
LintId::of(&map_clone::MAP_CLONE),
LintId::of(&map_err_ignore::MAP_ERR_IGNORE),
LintId::of(&map_identity::MAP_IDENTITY),
LintId::of(&map_unit_fn::OPTION_MAP_UNIT_FN),
LintId::of(&map_unit_fn::RESULT_MAP_UNIT_FN),
Expand Down Expand Up @@ -1538,7 +1538,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&manual_async_fn::MANUAL_ASYNC_FN),
LintId::of(&manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE),
LintId::of(&map_clone::MAP_CLONE),
LintId::of(&map_err_ignore::MAP_ERR_IGNORE),
LintId::of(&matches::INFALLIBLE_DESTRUCTURING_MATCH),
LintId::of(&matches::MATCH_LIKE_MATCHES_MACRO),
LintId::of(&matches::MATCH_OVERLAPPING_ARM),
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/map_err_ignore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ declare_clippy_lint! {
/// }
/// ```
pub MAP_ERR_IGNORE,
style,
pedantic,
"`map_err` should not ignore the original error"
}

Expand Down
2 changes: 1 addition & 1 deletion src/lintlist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
},
Lint {
name: "map_err_ignore",
group: "style",
group: "pedantic",
desc: "`map_err` should not ignore the original error",
deprecation: None,
module: "map_err_ignore",
Expand Down
1 change: 1 addition & 0 deletions tests/ui/map_err.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![warn(clippy::map_err_ignore)]
use std::convert::TryFrom;
use std::error::Error;
use std::fmt;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/map_err.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: `map_err(|_|...` ignores the original error
--> $DIR/map_err.rs:21:32
--> $DIR/map_err.rs:22:32
|
LL | println!("{:?}", x.map_err(|_| Errors::Ignored));
| ^^^
Expand Down

0 comments on commit d719b48

Please sign in to comment.