Skip to content

Commit

Permalink
Auto merge of #4307 - flip1995:unnecessary_unwrap, r=oli-obk
Browse files Browse the repository at this point in the history
Move {unnecessary,panicking}_unwrap out of nursery

Resolves #2437

changelog: Move `{unnnecessary,panicking}_unwrap` out of nursery
  • Loading branch information
bors committed Jul 31, 2019
2 parents d1b4fc9 + 87a2874 commit 297d3a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,8 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME,
unused_io_amount::UNUSED_IO_AMOUNT,
unused_label::UNUSED_LABEL,
unwrap::PANICKING_UNWRAP,
unwrap::UNNECESSARY_UNWRAP,
vec::USELESS_VEC,
write::PRINTLN_EMPTY_STRING,
write::PRINT_LITERAL,
Expand Down Expand Up @@ -1060,6 +1062,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
types::UNNECESSARY_CAST,
types::VEC_BOX,
unused_label::UNUSED_LABEL,
unwrap::UNNECESSARY_UNWRAP,
zero_div_zero::ZERO_DIVIDED_BY_ZERO,
]);

Expand Down Expand Up @@ -1121,6 +1124,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
types::UNIT_CMP,
unicode::ZERO_WIDTH_SPACE,
unused_io_amount::UNUSED_IO_AMOUNT,
unwrap::PANICKING_UNWRAP,
]);

reg.register_lint_group("clippy::perf", Some("clippy_perf"), vec![
Expand Down Expand Up @@ -1157,8 +1161,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
needless_borrow::NEEDLESS_BORROW,
path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE,
redundant_clone::REDUNDANT_CLONE,
unwrap::PANICKING_UNWRAP,
unwrap::UNNECESSARY_UNWRAP,
]);
}

Expand Down
6 changes: 3 additions & 3 deletions clippy_lints/src/unwrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ declare_clippy_lint! {
///
/// **Why is this bad?** Using `if let` or `match` is more idiomatic.
///
/// **Known problems:** Limitations of the borrow checker might make unwrap() necessary sometimes?
/// **Known problems:** None
///
/// **Example:**
/// ```rust
Expand All @@ -31,7 +31,7 @@ declare_clippy_lint! {
/// }
/// ```
pub UNNECESSARY_UNWRAP,
nursery,
complexity,
"checks for calls of unwrap[_err]() that cannot fail"
}

Expand All @@ -52,7 +52,7 @@ declare_clippy_lint! {
///
/// This code will always panic. The if condition should probably be inverted.
pub PANICKING_UNWRAP,
nursery,
correctness,
"checks for calls of unwrap[_err]() that will always fail"
}

Expand Down
4 changes: 2 additions & 2 deletions src/lintlist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ pub const ALL_LINTS: [Lint; 309] = [
},
Lint {
name: "panicking_unwrap",
group: "nursery",
group: "correctness",
desc: "checks for calls of unwrap[_err]() that will always fail",
deprecation: None,
module: "unwrap",
Expand Down Expand Up @@ -1927,7 +1927,7 @@ pub const ALL_LINTS: [Lint; 309] = [
},
Lint {
name: "unnecessary_unwrap",
group: "nursery",
group: "complexity",
desc: "checks for calls of unwrap[_err]() that cannot fail",
deprecation: None,
module: "unwrap",
Expand Down

0 comments on commit 297d3a5

Please sign in to comment.