Commit graph

14 commits

Author SHA1 Message Date
flip1995
fae7a09eea
match_wildcard_for_single_variants: don't produce bad suggestion
This fixes a bug where match_wildcard_for_single_variants produced a
bad suggestion where besides the missing variant, one or more hidden
variants were left.

This also adds tests to the ui-tests match_wildcard_for_single_variants
and wildcard_enum_match_arm to make sure that the correct suggestion is
produced.
2021-07-01 12:38:30 +02:00
flip1995
0ffba7a684
Simplify wildcard_enum_match_arm test 2021-07-01 11:47:56 +02:00
Mara Bos
3e59563394 Don't use exact definition of std's ErrorKind in test.
Every time we add something to this enum in std, this test breaks.
2021-06-26 14:50:42 +02:00
Kornel
b75354034c Add ErrorKind::OutOfMemory 2021-05-02 11:40:31 +01:00
Christiaan Dirkx
024a49aed1 Fix clippy test using ErrorKind 2021-04-18 09:29:24 +02:00
flip1995
9f6b5de7de Merge commit '0e87918536b9833bbc6c683d1f9d51ee2bf03ef1' into clippyup 2021-03-25 19:29:11 +01:00
flip1995
8eca423ea1 Merge commit 'c1664c50b27a51f7a78c93ba65558e7c33eabee6' into clippyup 2020-12-06 15:01:03 +01:00
Camelid
d708b444e4 Qualify panic! as core::panic! in non-built-in core macros
Otherwise code like this

    #![no_implicit_prelude]

    fn main() {
        ::std::todo!();
        ::std::unimplemented!();
    }

will fail to compile, which is unfortunate and presumably unintended.

This changes many invocations of `panic!` in a `macro_rules!` definition
to invocations of `$crate::panic!`, which makes the invocations hygienic.

Note that this does not make the built-in macro `assert!` hygienic.
2020-11-23 11:28:25 -08:00
Lzu Tao
8db24840f7 Merge commit 'ff0993c5e9162ddaea78e83d0f0161e68bd4ea73' into clippy 2020-06-09 14:36:01 +00:00
ThibsG
8ae8b08e32 Change lint name to WILDCARD_IN_OR_PATTERNS 2020-01-07 18:48:16 +01:00
ThibsG
d60c6f9398 Move to complexity and adapt test
- test wildcard_enum_match_arm has been impacted by this new lint
2020-01-07 18:48:16 +01:00
Daniel Wagner-Hall
c21b4ad7d4 Update wildcard enum match lint for non_exhaustive enums 2019-12-22 02:13:39 +00:00
Manish Goregaokar
982c51e769 arm.pats -> arm.pat 2019-09-25 12:52:16 -07:00
Philipp Hansch
afd7b180e5
Add run-rustfix for wildcard_enum_match_arm lint 2019-09-21 07:26:18 +02:00