From 0da18677f733f392ef7fa8d833ade3b66bf83f9a Mon Sep 17 00:00:00 2001 From: Alex Hamilton Date: Thu, 10 Jan 2019 14:56:28 -0600 Subject: [PATCH 01/12] Add match_wild lint (#3649). This lint prevents using a wildcard in a match. --- clippy_lints/src/matches.rs | 39 ++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/clippy_lints/src/matches.rs b/clippy_lints/src/matches.rs index b290980fc36..4be045175bb 100644 --- a/clippy_lints/src/matches.rs +++ b/clippy_lints/src/matches.rs @@ -187,6 +187,25 @@ declare_clippy_lint! { "a match on an Option value instead of using `as_ref()` or `as_mut`" } +/// **What it does:** Checks for wildcard matches using `_`. +/// +/// **Why is this bad?** New variants added by library updates can be missed. +/// +/// **Known problems:** None. +/// +/// **Example:** +/// ```rust +/// match x { +/// A => {}, +/// _ => {} +/// } +/// ``` +declare_clippy_lint! { + pub MATCH_WILD, + restriction, + "a wildcard match arm using `_`" +} + #[allow(missing_copy_implementations)] pub struct MatchPass; @@ -199,7 +218,8 @@ impl LintPass for MatchPass { SINGLE_MATCH_ELSE, MATCH_OVERLAPPING_ARM, MATCH_WILD_ERR_ARM, - MATCH_AS_REF + MATCH_AS_REF, + MATCH_WILD ) } @@ -218,6 +238,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MatchPass { check_match_bool(cx, ex, arms, expr); check_overlapping_arms(cx, ex, arms); check_wild_err_arm(cx, ex, arms); + check_wild_arm(cx, ex, arms); check_match_as_ref(cx, ex, arms, expr); } if let ExprKind::Match(ref ex, ref arms, _) = expr.node { @@ -442,6 +463,22 @@ fn check_wild_err_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) { } } +fn check_wild_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) { + let ex_ty = walk_ptrs_ty(cx.tables.expr_ty(ex)); + if match_type(cx, ex_ty, &paths::RESULT) { + for arm in arms { + if is_wild(&arm.pats[0]) { + span_note_and_lint(cx, + MATCH_WILD, + arm.pats[0].span, + "Wildcard match will miss any future added variants.", + arm.pats[0].span, + "to resolve, match each variant explicitly"); + } + } + } +} + // If the block contains only a `panic!` macro (as expression or statement) fn is_panic_block(block: &Block) -> bool { match (&block.expr, block.stmts.len(), block.stmts.first()) { From 1b3c3d073af9a022b7cfb620d455d25415f7ddc4 Mon Sep 17 00:00:00 2001 From: Alex Hamilton Date: Sat, 12 Jan 2019 17:45:16 -0600 Subject: [PATCH 02/12] Change match_wild lint name to WILDCARD_MATCH_ARM. Also fix message capitalization. --- clippy_lints/src/matches.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clippy_lints/src/matches.rs b/clippy_lints/src/matches.rs index 4be045175bb..bdade6ee19e 100644 --- a/clippy_lints/src/matches.rs +++ b/clippy_lints/src/matches.rs @@ -201,7 +201,7 @@ declare_clippy_lint! { /// } /// ``` declare_clippy_lint! { - pub MATCH_WILD, + pub WILDCARD_MATCH_ARM, restriction, "a wildcard match arm using `_`" } @@ -219,7 +219,7 @@ impl LintPass for MatchPass { MATCH_OVERLAPPING_ARM, MATCH_WILD_ERR_ARM, MATCH_AS_REF, - MATCH_WILD + WILDCARD_MATCH_ARM ) } @@ -469,9 +469,9 @@ fn check_wild_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) { for arm in arms { if is_wild(&arm.pats[0]) { span_note_and_lint(cx, - MATCH_WILD, + WILDCARD_MATCH_ARM, arm.pats[0].span, - "Wildcard match will miss any future added variants.", + "wildcard match will miss any future added variants.", arm.pats[0].span, "to resolve, match each variant explicitly"); } From 20ba476ea85b0d01fc468c565770f1fb61132273 Mon Sep 17 00:00:00 2001 From: Alex Hamilton Date: Fri, 25 Jan 2019 10:39:09 -0600 Subject: [PATCH 03/12] wildcard_match_arm: expand lint scope. We're not only working with Results. --- clippy_lints/src/matches.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/clippy_lints/src/matches.rs b/clippy_lints/src/matches.rs index bdade6ee19e..9d4279ad1bc 100644 --- a/clippy_lints/src/matches.rs +++ b/clippy_lints/src/matches.rs @@ -464,17 +464,14 @@ fn check_wild_err_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) { } fn check_wild_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) { - let ex_ty = walk_ptrs_ty(cx.tables.expr_ty(ex)); - if match_type(cx, ex_ty, &paths::RESULT) { - for arm in arms { - if is_wild(&arm.pats[0]) { - span_note_and_lint(cx, - WILDCARD_MATCH_ARM, - arm.pats[0].span, - "wildcard match will miss any future added variants.", - arm.pats[0].span, - "to resolve, match each variant explicitly"); - } + for arm in arms { + if is_wild(&arm.pats[0]) { + span_note_and_lint(cx, + WILDCARD_MATCH_ARM, + arm.pats[0].span, + "wildcard match will miss any future added variants.", + arm.pats[0].span, + "to resolve, match each variant explicitly"); } } } From 068924198babed20c11715bb4f4acb9f2e470a9c Mon Sep 17 00:00:00 2001 From: Alex Hamilton Date: Fri, 25 Jan 2019 10:42:11 -0600 Subject: [PATCH 04/12] wildcard_match_arm: add simple ui test. --- tests/ui/wildcard_match_arm.rs | 36 ++++++++++++++++++++++++++++++ tests/ui/wildcard_match_arm.stderr | 15 +++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 tests/ui/wildcard_match_arm.rs create mode 100644 tests/ui/wildcard_match_arm.stderr diff --git a/tests/ui/wildcard_match_arm.rs b/tests/ui/wildcard_match_arm.rs new file mode 100644 index 00000000000..26a37c969a3 --- /dev/null +++ b/tests/ui/wildcard_match_arm.rs @@ -0,0 +1,36 @@ +#![deny(clippy::wildcard_match_arm)] + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +enum Color { + Red, + Green, + Blue, + Rgb(u8, u8, u8), + Cyan, +} + +impl Color { + fn is_monochrome(self) -> bool { + match self { + Color::Red | Color::Green | Color::Blue => true, + Color::Rgb(r, g, b) => r | g == 0 || r | b == 0 || g | b == 0, + Color::Cyan => false, + } + } +} + +fn main() { + let color = Color::Rgb(0, 0, 127); + match color { + Color::Red => println!("Red"), + _ => eprintln!("Not red"), + }; + match color { + Color::Red => {}, + Color::Green => {}, + Color::Blue => {}, + Color::Cyan => {}, + c if c.is_monochrome() => {}, + Color::Rgb(_, _, _) => {}, + }; +} \ No newline at end of file diff --git a/tests/ui/wildcard_match_arm.stderr b/tests/ui/wildcard_match_arm.stderr new file mode 100644 index 00000000000..0d10382dc15 --- /dev/null +++ b/tests/ui/wildcard_match_arm.stderr @@ -0,0 +1,15 @@ +error: wildcard match will miss any future added variants. + --> $DIR/wildcard_match_arm.rs:26:3 + | +LL | _ => eprintln!("Not red"), + | ^ + | +note: lint level defined here + --> $DIR/wildcard_match_arm.rs:1:9 + | +LL | #![deny(clippy::wildcard_match_arm)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: to resolve, match each variant explicitly + +error: aborting due to previous error + From 23eae0909db7f7315f083fa019ee301e93195fcc Mon Sep 17 00:00:00 2001 From: Alex Hamilton Date: Fri, 25 Jan 2019 10:56:00 -0600 Subject: [PATCH 05/12] wildcard_match_arm: rename function. We also don't need `ex` as an argument. --- clippy_lints/src/matches.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/matches.rs b/clippy_lints/src/matches.rs index 9d4279ad1bc..024c88b368c 100644 --- a/clippy_lints/src/matches.rs +++ b/clippy_lints/src/matches.rs @@ -238,7 +238,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MatchPass { check_match_bool(cx, ex, arms, expr); check_overlapping_arms(cx, ex, arms); check_wild_err_arm(cx, ex, arms); - check_wild_arm(cx, ex, arms); + check_wild_match(cx, arms); check_match_as_ref(cx, ex, arms, expr); } if let ExprKind::Match(ref ex, ref arms, _) = expr.node { @@ -463,7 +463,7 @@ fn check_wild_err_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) { } } -fn check_wild_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) { +fn check_wild_match(cx: &LateContext<'_, '_>, arms: &[Arm]) { for arm in arms { if is_wild(&arm.pats[0]) { span_note_and_lint(cx, From c75dfeb29bc9e8e259382fe8af3917e43f07a9e4 Mon Sep 17 00:00:00 2001 From: Alex Hamilton Date: Fri, 25 Jan 2019 11:06:19 -0600 Subject: [PATCH 06/12] wildcard_match_arm: add lint properly. --- CHANGELOG.md | 1 + clippy_lints/src/lib.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0679d280c2..2ac88d09a53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1028,6 +1028,7 @@ All notable changes to this project will be documented in this file. [`while_let_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [`while_let_on_iterator`]: https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [`wildcard_dependencies`]: https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_dependencies +[`wildcard_match_arm`]: https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_match_arm [`write_literal`]: https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [`write_with_newline`]: https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [`writeln_empty_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#writeln_empty_string diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 3483aae0ca3..f4ba38496be 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -499,6 +499,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) { indexing_slicing::INDEXING_SLICING, inherent_impl::MULTIPLE_INHERENT_IMPL, literal_representation::DECIMAL_LITERAL_REPRESENTATION, + matches::WILDCARD_MATCH_ARM, mem_forget::MEM_FORGET, methods::CLONE_ON_REF_PTR, methods::OPTION_UNWRAP_USED, From 6bc4416b2b41a9d655cef8de0ee3ef0d5632bbb1 Mon Sep 17 00:00:00 2001 From: Alex Hamilton Date: Sun, 27 Jan 2019 15:41:22 -0600 Subject: [PATCH 07/12] wilcard_match_arm: run rustfmt. --- clippy_lints/src/matches.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/matches.rs b/clippy_lints/src/matches.rs index 024c88b368c..0245b5a1362 100644 --- a/clippy_lints/src/matches.rs +++ b/clippy_lints/src/matches.rs @@ -197,7 +197,7 @@ declare_clippy_lint! { /// ```rust /// match x { /// A => {}, -/// _ => {} +/// _ => {}, /// } /// ``` declare_clippy_lint! { @@ -466,12 +466,14 @@ fn check_wild_err_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) { fn check_wild_match(cx: &LateContext<'_, '_>, arms: &[Arm]) { for arm in arms { if is_wild(&arm.pats[0]) { - span_note_and_lint(cx, + span_note_and_lint( + cx, WILDCARD_MATCH_ARM, arm.pats[0].span, "wildcard match will miss any future added variants.", arm.pats[0].span, - "to resolve, match each variant explicitly"); + "to resolve, match each variant explicitly", + ); } } } From c7ae44c0e2aad23e6ca74893a3e3ed1a060c0ff0 Mon Sep 17 00:00:00 2001 From: Alex Hamilton Date: Tue, 29 Jan 2019 12:23:11 -0600 Subject: [PATCH 08/12] wildcard_match_arm: format test. --- tests/ui/wildcard_match_arm.rs | 52 +++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/tests/ui/wildcard_match_arm.rs b/tests/ui/wildcard_match_arm.rs index 26a37c969a3..5d3a5ff2a75 100644 --- a/tests/ui/wildcard_match_arm.rs +++ b/tests/ui/wildcard_match_arm.rs @@ -2,35 +2,35 @@ #[derive(Clone, Copy, Debug, Eq, PartialEq)] enum Color { - Red, - Green, - Blue, - Rgb(u8, u8, u8), - Cyan, + Red, + Green, + Blue, + Rgb(u8, u8, u8), + Cyan, } impl Color { - fn is_monochrome(self) -> bool { - match self { - Color::Red | Color::Green | Color::Blue => true, - Color::Rgb(r, g, b) => r | g == 0 || r | b == 0 || g | b == 0, - Color::Cyan => false, - } - } + fn is_monochrome(self) -> bool { + match self { + Color::Red | Color::Green | Color::Blue => true, + Color::Rgb(r, g, b) => r | g == 0 || r | b == 0 || g | b == 0, + Color::Cyan => false, + } + } } fn main() { - let color = Color::Rgb(0, 0, 127); - match color { - Color::Red => println!("Red"), - _ => eprintln!("Not red"), - }; - match color { - Color::Red => {}, - Color::Green => {}, - Color::Blue => {}, - Color::Cyan => {}, - c if c.is_monochrome() => {}, - Color::Rgb(_, _, _) => {}, - }; -} \ No newline at end of file + let color = Color::Rgb(0, 0, 127); + match color { + Color::Red => println!("Red"), + _ => eprintln!("Not red"), + }; + match color { + Color::Red => {}, + Color::Green => {}, + Color::Blue => {}, + Color::Cyan => {}, + c if c.is_monochrome() => {}, + Color::Rgb(_, _, _) => {}, + }; +} From c676578097eb785cc3933ce363a93affc726ff51 Mon Sep 17 00:00:00 2001 From: Alex Hamilton Date: Tue, 29 Jan 2019 12:39:01 -0600 Subject: [PATCH 09/12] wildcard_match_arm: update ui test stderr --- tests/ui/wildcard_match_arm.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ui/wildcard_match_arm.stderr b/tests/ui/wildcard_match_arm.stderr index 0d10382dc15..b78a82f60b5 100644 --- a/tests/ui/wildcard_match_arm.stderr +++ b/tests/ui/wildcard_match_arm.stderr @@ -1,5 +1,5 @@ error: wildcard match will miss any future added variants. - --> $DIR/wildcard_match_arm.rs:26:3 + --> $DIR/wildcard_match_arm.rs:26:9 | LL | _ => eprintln!("Not red"), | ^ From efaed8e0c0bc67d46a647a0ceb94b4b095ce04db Mon Sep 17 00:00:00 2001 From: Alex Hamilton Date: Tue, 29 Jan 2019 14:25:40 -0600 Subject: [PATCH 10/12] wildcard_match_arm: lint only enum matches. --- CHANGELOG.md | 2 +- clippy_lints/src/lib.rs | 2 +- clippy_lints/src/matches.rs | 36 ++++++++++--------- ...atch_arm.rs => wildcard_enum_match_arm.rs} | 8 ++++- ....stderr => wildcard_enum_match_arm.stderr} | 8 ++--- 5 files changed, 32 insertions(+), 24 deletions(-) rename tests/ui/{wildcard_match_arm.rs => wildcard_enum_match_arm.rs} (83%) rename tests/ui/{wildcard_match_arm.stderr => wildcard_enum_match_arm.stderr} (58%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ac88d09a53..71066aadfcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1028,7 +1028,7 @@ All notable changes to this project will be documented in this file. [`while_let_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [`while_let_on_iterator`]: https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [`wildcard_dependencies`]: https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_dependencies -[`wildcard_match_arm`]: https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_match_arm +[`wildcard_enum_match_arm`]: https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_enum_match_arm [`write_literal`]: https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [`write_with_newline`]: https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [`writeln_empty_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#writeln_empty_string diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index f4ba38496be..52cc2a88da4 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -499,7 +499,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) { indexing_slicing::INDEXING_SLICING, inherent_impl::MULTIPLE_INHERENT_IMPL, literal_representation::DECIMAL_LITERAL_REPRESENTATION, - matches::WILDCARD_MATCH_ARM, + matches::WILDCARD_ENUM_MATCH_ARM, mem_forget::MEM_FORGET, methods::CLONE_ON_REF_PTR, methods::OPTION_UNWRAP_USED, diff --git a/clippy_lints/src/matches.rs b/clippy_lints/src/matches.rs index 0245b5a1362..e0094b19998 100644 --- a/clippy_lints/src/matches.rs +++ b/clippy_lints/src/matches.rs @@ -187,9 +187,9 @@ declare_clippy_lint! { "a match on an Option value instead of using `as_ref()` or `as_mut`" } -/// **What it does:** Checks for wildcard matches using `_`. +/// **What it does:** Checks for wildcard enum matches using `_`. /// -/// **Why is this bad?** New variants added by library updates can be missed. +/// **Why is this bad?** New enum variants added by library updates can be missed. /// /// **Known problems:** None. /// @@ -201,9 +201,9 @@ declare_clippy_lint! { /// } /// ``` declare_clippy_lint! { - pub WILDCARD_MATCH_ARM, + pub WILDCARD_ENUM_MATCH_ARM, restriction, - "a wildcard match arm using `_`" + "a wildcard enum match arm using `_`" } #[allow(missing_copy_implementations)] @@ -219,7 +219,7 @@ impl LintPass for MatchPass { MATCH_OVERLAPPING_ARM, MATCH_WILD_ERR_ARM, MATCH_AS_REF, - WILDCARD_MATCH_ARM + WILDCARD_ENUM_MATCH_ARM ) } @@ -238,7 +238,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MatchPass { check_match_bool(cx, ex, arms, expr); check_overlapping_arms(cx, ex, arms); check_wild_err_arm(cx, ex, arms); - check_wild_match(cx, arms); + check_wild_enum_match(cx, ex, arms); check_match_as_ref(cx, ex, arms, expr); } if let ExprKind::Match(ref ex, ref arms, _) = expr.node { @@ -463,17 +463,19 @@ fn check_wild_err_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) { } } -fn check_wild_match(cx: &LateContext<'_, '_>, arms: &[Arm]) { - for arm in arms { - if is_wild(&arm.pats[0]) { - span_note_and_lint( - cx, - WILDCARD_MATCH_ARM, - arm.pats[0].span, - "wildcard match will miss any future added variants.", - arm.pats[0].span, - "to resolve, match each variant explicitly", - ); +fn check_wild_enum_match(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) { + if cx.tables.expr_ty(ex).is_enum() { + for arm in arms { + if is_wild(&arm.pats[0]) { + span_note_and_lint( + cx, + WILDCARD_ENUM_MATCH_ARM, + arm.pats[0].span, + "wildcard match will miss any future added variants.", + arm.pats[0].span, + "to resolve, match each variant explicitly", + ); + } } } } diff --git a/tests/ui/wildcard_match_arm.rs b/tests/ui/wildcard_enum_match_arm.rs similarity index 83% rename from tests/ui/wildcard_match_arm.rs rename to tests/ui/wildcard_enum_match_arm.rs index 5d3a5ff2a75..58daabf4268 100644 --- a/tests/ui/wildcard_match_arm.rs +++ b/tests/ui/wildcard_enum_match_arm.rs @@ -1,4 +1,4 @@ -#![deny(clippy::wildcard_match_arm)] +#![deny(clippy::wildcard_enum_match_arm)] #[derive(Clone, Copy, Debug, Eq, PartialEq)] enum Color { @@ -33,4 +33,10 @@ fn main() { c if c.is_monochrome() => {}, Color::Rgb(_, _, _) => {}, }; + let x: u8 = unimplemented!(); + match x { + 0 => {}, + 140 => {}, + _ => {}, + }; } diff --git a/tests/ui/wildcard_match_arm.stderr b/tests/ui/wildcard_enum_match_arm.stderr similarity index 58% rename from tests/ui/wildcard_match_arm.stderr rename to tests/ui/wildcard_enum_match_arm.stderr index b78a82f60b5..6319a3f3d46 100644 --- a/tests/ui/wildcard_match_arm.stderr +++ b/tests/ui/wildcard_enum_match_arm.stderr @@ -1,14 +1,14 @@ error: wildcard match will miss any future added variants. - --> $DIR/wildcard_match_arm.rs:26:9 + --> $DIR/wildcard_enum_match_arm.rs:26:9 | LL | _ => eprintln!("Not red"), | ^ | note: lint level defined here - --> $DIR/wildcard_match_arm.rs:1:9 + --> $DIR/wildcard_enum_match_arm.rs:1:9 | -LL | #![deny(clippy::wildcard_match_arm)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![deny(clippy::wildcard_enum_match_arm)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: to resolve, match each variant explicitly error: aborting due to previous error From 587492b5d243273f7170ee9036ca18bbedbebc77 Mon Sep 17 00:00:00 2001 From: Alex Hamilton Date: Tue, 29 Jan 2019 14:34:04 -0600 Subject: [PATCH 11/12] wildcard_match_arm: add nesting issue to known. --- clippy_lints/src/matches.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_lints/src/matches.rs b/clippy_lints/src/matches.rs index e0094b19998..6ef07316691 100644 --- a/clippy_lints/src/matches.rs +++ b/clippy_lints/src/matches.rs @@ -191,7 +191,7 @@ declare_clippy_lint! { /// /// **Why is this bad?** New enum variants added by library updates can be missed. /// -/// **Known problems:** None. +/// **Known problems:** Nested wildcards a la `Foo(_)` are currently not detected. /// /// **Example:** /// ```rust From 7fa50fb3fe98f3c6f837e95e6d13810c68ceaf74 Mon Sep 17 00:00:00 2001 From: Alex Hamilton Date: Tue, 29 Jan 2019 15:33:16 -0600 Subject: [PATCH 12/12] wildcard_match_arm: Update lint count. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dad18ef7569..c1f457a956e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code. -[There are 293 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html) +[There are 294 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html) We have a bunch of lint categories to allow you to choose how much Clippy is supposed to ~~annoy~~ help you: