Commit graph

10 commits

Author SHA1 Message Date
Jason Newcomb
0b7ab90eca
Improvements to match_wildcard_for_single_variants and wildcard_enum_match_arm lints
Don't lint on `Result` and `Option` types.
Considers `or` patterns.
Considers variants prefixed with `Self`
Suggestions will try to find a common prefix rather than just using the full path
2021-03-17 12:04:11 -04:00
flip1995
c6a577ea11
Merge remote-tracking branch 'upstream/master' into rustup 2020-11-24 17:05:01 +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
Mazdak Farrokhzad
7b6dc7b33d
add unnested_or_patterns lint 2020-06-07 21:09:47 +02: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