Elichai Turkel
ecd0a67b01
Make match_wild_err_arm pedantic, and update help messages
2020-05-20 16:39:03 +03:00
bors
cafa94662c
Auto merge of #5582 - vtmargaryan:match_wildcard_for_single_variants, r=flip1995
...
New lint: `match_wildcard_for_single_variants`
changelog: Added a new lint match_wildcard_for_single_variants to warn on enum matches where a wildcard is used to match a single variant
Closes #5556
2020-05-20 12:51:28 +00:00
Aleksei Latyshev
cb7f9679a6
simplify multispan_sugg interface
...
- add `multispan_sugg_with_applicability`
- not it gets `&str` instead of `String`, like in `diag.multispan_suggestion`
2020-05-17 00:09:37 +03:00
Vardan Margaryan
2620d2449d
Fix check for missing enum variants from match expressions
...
TupleStruct matches are checked for exhaustiveness
2020-05-16 00:06:52 +03:00
Vardan Margaryan
1c59cd5f21
Fix example code of wildcard_enum_match_arm lint
2020-05-14 22:41:05 +03:00
Vardan Margaryan
749619cfe3
Apply suggestions from PR review
2020-05-14 22:40:33 +03:00
Vardan Margaryan
94e4b5ec31
Add the redundant_wildcard_enum_match lint
2020-05-14 22:36:46 +03:00
David Tolnay
ef28361293
Downgrade match_bool to pedantic
2020-04-23 16:30:06 -07:00
xiongmao86
d7f1a1ed2b
Change note_span argument for span_lint_and_note.
2020-04-18 18:29:36 +08:00
xiongmao86
cf4e35339b
Add an Option<Span> argument to span_lint_and_help.
2020-04-18 18:28:29 +08:00
Philipp Hansch
870ae36f85
Cleanup: Rename 'db' variable to 'diag'
2020-04-17 08:08:00 +02:00
ThibsG
7fb94c2ac9
Do not lint in macros for match lints
2020-04-16 14:57:12 +02:00
Philipp Hansch
a524be6df5
cargo dev fmt
2020-04-12 15:23:54 +02:00
Philipp Hansch
83874d0ee7
Make use of Option/Result diagnostic items
2020-04-12 15:23:07 +02:00
flip1995
30503a91d2
Move matches test in matches module
2020-04-03 22:02:27 +02:00
pmk21
4cac9786c5
Skip single_match lints in macro rules
2020-03-31 15:50:15 +05:30
Matthias Krüger
aff57e0f43
rustup https://github.com/rust-lang/rust/pull/70536
2020-03-30 11:17:58 +02:00
Matthias Krüger
0982097e4d
remove redundant import
2020-03-27 20:47:34 +01:00
Matthias Krüger
8177e49e10
rustup https://github.com/rust-lang/rust/pull/70344
2020-03-27 20:41:35 +01:00
ThibsG
badfbbbbde
Fix single binding in closure
2020-03-22 10:31:30 +01:00
ThibsG
40a04f2657
Fix match single binding when in a let stmt
2020-03-09 16:59:24 +01:00
ThibsG
2aa14c9beb
Add restrictive pat use in full binded struct
2020-03-04 09:11:07 +01:00
Yuki Okushi
4253aa7137
Rustup to rust-lang/rust#69592
2020-03-01 12:23:33 +09:00
flip1995
8472ecda0f
Fix fallout
2020-02-21 11:14:18 +01:00
Yuki Okushi
f4b80394d7
Use Vec::with_capacity()
as possible
2020-02-18 22:37:45 +09:00
flip1995
c7979d3515
Fix rebase fallout
2020-02-06 19:15:01 +01:00
flip1995
5fd22b3f93
Optionally indent snippet_block relative to an Expr
2020-02-06 19:13:45 +01:00
ThibsG
00904cb100
Manage macros case + move to MaybeIncorrect when binding values
2020-02-04 22:54:42 +01:00
ThibsG
b29aacfec8
Add wild and struct handling
2020-02-04 22:53:24 +01:00
ThibsG
6afd7ea147
Use span_lint_and_sugg + move infaillible lint
...
- moving infaillible lint to prevent collisions
2020-02-04 22:49:08 +01:00
ThibsG
3445d41f07
Add new lint: match with a single binding statement
...
- Lint name: MATCH_SINGLE_BINDING
2020-02-04 01:06:16 +01:00
Yuki Okushi
f5e86d6894
Rename span_note_and_lint
to span_lint_and_note
2020-01-27 11:26:42 +09:00
Yuki Okushi
f60f12f71f
Rename span_help_and_lint
to span_lint_and_help
2020-01-27 11:17:58 +09:00
ThibsG
44fb8b5e88
Extract visitor to utils
2020-01-13 16:50:11 +01:00
ThibsG
d3c76b5b2a
Change note message
2020-01-13 16:25:35 +01:00
ThibsG
95cc500e9d
Fix formatting
2020-01-13 16:25:35 +01:00
ThibsG
e5c9073f9c
Better binding name on Err for note
2020-01-13 16:25:35 +01:00
ThibsG
f79c47f28d
Match underscore-prefixed variable also
2020-01-13 16:25:35 +01:00
Yuki Okushi
ce1c6b285d
Rustup to rust-lang/rust#68045
2020-01-13 21:55:57 +09:00
Yuki Okushi
3bdf404076
Apply review comments
2020-01-11 23:21:09 +09:00
Yuki Okushi
39947992b5
Rustup to rust-lang/rust#67806
2020-01-11 21:50:00 +09:00
Yuki Okushi
10cf141ebb
Apply review comments
2020-01-11 19:39:43 +09:00
Yuki Okushi
1d7d4e9217
Rustup to rust-lang/rust#67258
2020-01-11 09:05:51 +09:00
ThibsG
0fa0df9efb
Span help without suggestion
2020-01-07 19:10:59 +01:00
ThibsG
8ae8b08e32
Change lint name to WILDCARD_IN_OR_PATTERNS
2020-01-07 18:48:16 +01:00
ThibsG
58deaad42d
Handle case for non-exhaustive enums
2020-01-07 18:48:16 +01:00
ThibsG
649af71f9e
Change group and use only func call
2020-01-07 18:48:16 +01:00
ThibsG
8ec32175fa
Remove useless parameters in func call
2020-01-07 18:48:16 +01:00
ThibsG
96c4198832
New lint: pats_with_wild_match_arm
...
- Wildcard use with other pattern in same match arm
2020-01-07 18:48:16 +01:00
Yuki Okushi
5ac08b0cc9
Normalize lint messages
2020-01-07 18:26:55 +09:00