Bastian Kauschke
091239ee60
introduce newtype'd Predicate<'tcx>
2020-05-20 15:44:34 +02:00
Bastian Kauschke
2722522fac
rename Predicate
to PredicateKind
, introduce alias
2020-05-20 15:38:03 +02: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
flip1995
f28f1f15da
Fix dogfood fallout
2020-05-20 13:32:53 +02:00
Amanieu d'Antras
d25b25610b
Handle InlineAsm in clippy
2020-05-18 14:41:33 +01:00
Rahul Butani
1b3dc5f79b
Add to the list of words clippy::doc_markdown ignores
2020-05-17 22:21:02 -05:00
flip1995
f1d3086492
Merge commit 'e214ea82ad0a751563acf67e1cd9279cf302db3a' into clippyup
2020-05-17 17:36:26 +02:00
bors
6ae0643d1a
Auto merge of #5529 - alex-700:improve-option-and-then-some-lint, r=phansch
...
Improve `option_and_then_some` lint
fixed #5492
changelog: Improve and generalize `option_and_then_some` and rename it to `bind_instead_of_map`.
2020-05-17 10:58:56 +00:00
flip1995
cb0d40a7ec
Merge remote-tracking branch 'upstream/master' into rustup
2020-05-17 01:13:02 +02: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
Dylan DPC
b0490cc80d
Rollup merge of #71948 - csmoe:issue-61076, r=oli-obk
...
Suggest to await future before ? operator
Closes https://github.com/rust-lang/rust/issues/71811
cc #61076
2020-05-16 02:37:21 +02: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
10313a2631
Revert "Fix cases of match_wildcard_for_single_variants lint when it is spanned on Option"
...
This reverts commit 4948307977
.
2020-05-15 22:33:37 +03:00
csmoe
0a86335cd4
implement type_implments_trait query
2020-05-15 15:37:11 +08:00
Vardan Margaryan
4948307977
Fix cases of match_wildcard_for_single_variants lint when it is spanned on Option
2020-05-14 22:36:46 +03:00
flip1995
505280b108
Run cargo dev fmt
2020-05-11 21:31:01 +02:00
Camille GILLOT
8ab3224b3b
Fix clippy.
2020-05-11 21:26:39 +02:00
flip1995
d13d8987b0
Merge commit '43a1777b89cf6791f9e20878b4e5e3ae907867a5' into clippyup
2020-05-11 20:23:47 +02:00
Glenn Hope
ad92486d52
Add check for "test" in parent name. Include flag for disabling wildcard import exceptions
2020-05-09 11:09:38 -07:00
Camille GILLOT
31c84e5077
Fix clippy.
2020-05-08 13:57:01 +02:00
Eduardo Broto
3e4bc026e2
Apply suggestions from PR review
2020-05-07 22:40:28 +02:00
Eduardo Broto
3b58d66b22
Add the manual_async_fn lint
2020-05-07 21:42:40 +02:00
bors
76ddac5e8e
Auto merge of #5560 - CrazyRoka:fix-match-on-vector-full-range, r=phansch,flip1995
...
Fix match on vec items: match on vec[..]
- Added new tests
- Fixed false positive when matching on full range, which will never panic
Closes #5551
changelog: fix match_on_vec_items when matching full range
2020-05-02 16:13:02 +00:00
CrazyRoka
de58c5644d
Changed RANGE_FULL constant in utils
2020-05-02 17:37:03 +03:00
Aleksei Latyshev
d0c1f8ada2
fix fp on while-let-on-iterator
...
- fix `is_refutable` for slice patterns
- fix `is_refutable` for bindings
- add some TODO-s for cases, which can not be fixed easily
2020-05-02 14:21:29 +03:00
Matthias Krüger
bdc9528e7c
rustup https://github.com/rust-lang/rust/pull/71292/
2020-04-28 15:05:56 +02:00
csmoe
305177d9cc
rustup: rust-lang/rust#71628
2020-04-27 22:40:56 +08:00
Philipp Hansch
0480ff861a
More diagnostic items
...
In particular for:
* `VecDeque`
* `String`
* `Mutex`
* `HashMap`
* `HashSet`
cc https://github.com/rust-lang/rust/pull/71414 https://github.com/rust-lang/rust-clippy/issues/5393
2020-04-26 13:44:08 +02:00
Philipp Krones
a33d64a4c3
Rollup merge of #5505 - flip1995:avoid_running_lints, r=matthiaskrgr
...
Avoid running cargo+internal lints when not enabled
r? @matthiaskrgr
changelog: none
2020-04-25 21:06:27 +02:00
Matthias Krüger
f9c1acbc45
rustup https://github.com/rust-lang/rust/pull/71215/
2020-04-24 15:29:31 +02:00
flip1995
f31502f4bb
Only run (late) internal lints, when they are warn/deny/forbid
2020-04-22 20:51:58 +02:00
flip1995
14f596cb74
Only run cargo lints, when they are warn/deny/forbid
2020-04-22 20:32:37 +02:00
Andy Weiss
2dc8c083f5
Switch to matching against full paths instead of just the last element of the path
2020-04-21 21:07:43 -07:00
Eduardo Broto
00b4f2819f
Implement unsafe_derive_deserialize lint
2020-04-19 23:26:17 +02:00
Philipp Krones
98a244fc27
Formatting and naming
2020-04-19 20:40:25 +02:00
Philipp Krones
41115d994a
Formatting and naming
2020-04-19 20:38:07 +02: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
xiongmao86
bdd32e7700
Implement collapsible_span_lint_calls lint.
2020-04-18 18:13:50 +08:00
Philipp Hansch
870ae36f85
Cleanup: Rename 'db' variable to 'diag'
2020-04-17 08:08:00 +02:00
Philipp Krones
19183a6af5
Rollup merge of #5468 - Toxyxer:zero-single-char-names, r=flip1995
...
Zero single char names
Fixes : #4086
changelog:
- Make the inequality strict
2020-04-15 20:12:31 +02:00
Philipp Krones
ceea3c6a35
Rollup merge of #5248 - ThibsG:ConstValues, r=flip1995
...
Add lint on large non scalar const
This PR adds the new lint `non_scalar_const` that aims to warn against `const` declaration of large arrays. For performance, because of inlining, large arrays should be preferably declared as `static`.
Note: i made this one to warn on all const arrays, whether they are in a body function or not. I don't know if this is really necessary, i could just reduce this lint to variables out of function scope.
Fixes : #400
changelog: add new lint for large non-scalar types declared as const
2020-04-15 20:12:28 +02:00
Philipp Krones
a353f0f174
Rename dummy_hir_id -> parent_hir_id
2020-04-15 19:46:05 +02:00
Matthias Krüger
721549569c
rustup https://github.com/rust-lang/rust/pull/71116
2020-04-15 18:58:44 +02:00
Marcin Serwin
ce372c17cd
Change default many single char names threshold
2020-04-15 17:58:26 +02:00
bors
c6cc07a851
Auto merge of #5452 - phansch:match_def_path_refactor, r=matthiaskrgr
...
Refactor: Use rustc's `match_def_path`
This replaces our match_def_path implementation with the rustc one.
Note that we can't just use it in all call sites because of the
`&[&str]` / `&[Symbol]` difference in Clippy/rustc.
changelog: none
2020-04-15 05:42:52 +00:00
Philipp Hansch
9ec95af702
Refactor: Use rustc's match_def_path
...
This replaces our match_def_path implementation with the rustc one.
Note that we can't just use it in all call sites because of the
`&[&str]` / `&[Symbol]` difference in Clippy/rustc.
2020-04-15 07:23:13 +02:00
bors
81b3e7096b
Auto merge of #5449 - phansch:diagnostic-items, r=matthiaskrgr
...
Make use of more diagnostic items
This makes use of some (not all) already existing diagnostic items. Specifically:
* 79982a2
: `core::mem::uninitialized`, `core::mem::zeroed`, `alloc::sync::Arc`, `alloc::sync::Rc`
* 83874d0
: `Option` and `Result`
cc #5393
changelog: none
2020-04-14 19:58:17 +00:00
Philipp Hansch
e47db677ac
Cleanup: Use rustc's is_proc_macro_attr
...
It's doing exactly the same: https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_ast/expand/mod.rs.html#8-12
2020-04-13 09:33:00 +02:00
Philipp Hansch
79982a2813
Make use of some existing diagnostic items
2020-04-12 13:58:04 +02:00
Philipp Hansch
1d1b6d886b
Say that diagnostic items are preferred over paths
2020-04-12 13:58:04 +02:00
Matthias Krüger
f7bdead5ec
rustup https://github.com/rust-lang/rust/pull/69745
2020-04-11 01:51:25 +02:00
ThibsG
629cc4ada3
Update doc generation script
2020-04-09 09:17:41 +02:00
Linus Färnstrand
51bb1d28c5
Use assoc const NAN for zero_div_zero lint
2020-04-08 00:43:27 +02:00
flip1995
98aa5938c4
Rustup to rust-lang/rust#70634
2020-04-02 22:29:41 +02:00
Jacek Pospychala
f8e892db5e
useless Rc<Rc<T>>, Rc<Box<T>>, Rc<&T>, Box<&T>
2020-04-02 00:02:25 +02:00
flip1995
7d58ba20b4
Rustup to rust-lang/rust#70632
2020-04-01 20:14:05 +02:00
Tomasz Miąsko
b77b219280
Lint unnamed address comparisons
2020-03-30 21:42:16 +02:00
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
48da6e926c
rustup https://github.com/rust-lang/rust/pull/68404
2020-03-27 20:41:53 +01:00
Matthias Krüger
8177e49e10
rustup https://github.com/rust-lang/rust/pull/70344
2020-03-27 20:41:35 +01:00
Philipp Hansch
cec1e8f74e
Remove dependency on matches
crate
...
The std equivalent works exactly the same.
2020-03-25 07:50:08 +01:00
bors
d3989eef2d
Auto merge of #5319 - 1tgr:master, r=flip1995
...
Lint for `pub(crate)` items that are not crate visible due to the visibility of the module that contains them
changelog: Add `redundant_pub_crate` lint
Closes #5274 .
2020-03-23 20:35:49 +00:00
Tim Robinson
870b9e8139
nursery group -> style
2020-03-23 16:45:31 +00:00
Philipp Krones
606e3285b2
Rollup merge of #5341 - flip1995:rustup, r=flip1995
...
Rustup to rust-lang/rust#66131
changelog: none
2020-03-19 15:00:32 +01:00
flip1995
21aeb21b8a
Rustup to rust-lang/rust#66131
2020-03-19 14:33:10 +01:00
Matthias Krüger
b9d6bf3bfb
rustup https://github.com/rust-lang/rust/pull/69920/
2020-03-19 09:14:53 +01:00
Matthias Krüger
a97f60b8e3
rustup https://github.com/rust-lang/rust/pull/69738
2020-03-16 18:38:30 +01:00
bors
24f6d643fe
Auto merge of #5322 - phansch:or_patterns, r=matthiaskrgr
...
Make use of `or_patterns` feature
changelog: none
2020-03-16 12:41:04 +00:00
Matthias Krüger
ba0884bee3
rustup https://github.com/rust-lang/rust/pull/68944
2020-03-16 11:36:17 +01:00
Philipp Hansch
548c417ec4
Make use of or_patterns
feature
2020-03-16 07:25:09 +01:00
Matthias Krüger
4d8ed5a842
rustup https://github.com/rust-lang/rust/pull/69589/
2020-03-15 18:23:43 +01:00
Yuki Okushi
00861d100d
Rustup to rust-lang/rust#69076
2020-03-15 05:26:32 +09:00
bors
fdce47ba7d
Auto merge of #5272 - jmeyers35:file_read_lint, r=flip1995
...
add lint on File::read_to_string and File::read_to_end
Adds lint `verbose_file_reads` which checks for use of File::read_to_end and File::read_to_string.
Closes https://github.com/rust-lang/rust-clippy/issues/4916
changelog: add lint on File::{read_to_end, read_to_string}
2020-03-10 22:35:15 +00:00
Shotaro Yamada
227ef60a2b
Fix doc
2020-03-10 13:28:45 +09:00
Shotaro Yamada
a3d9355bef
Fix ICE with trivial_bounds feature
2020-03-10 13:17:35 +09:00
Jacob Meyers
0f7f30711e
add lint on File::read_to_string and File::read_to_end
2020-03-06 09:50:49 -05:00
mlegner
d14fdc0203
Move NumericLiteral to its own module.
2020-03-04 13:22:53 +01:00
flip1995
91042db2e8
Add path for display trait
2020-03-03 10:54:30 +01:00
flip1995
58cea334ec
Use lang items instead of get_trait_def_id where possible
2020-03-03 10:54:30 +01:00
Yuki Okushi
4253aa7137
Rustup to rust-lang/rust#69592
2020-03-01 12:23:33 +09:00
flip1995
b562a519e6
Don't use use ty::TyKind::*
2020-02-21 11:14:18 +01:00
flip1995
8472ecda0f
Fix fallout
2020-02-21 11:14:18 +01:00
Yuki Okushi
06cb96ed72
Clean up imports
2020-02-18 22:37:45 +09:00
daxpedda
0ee393cf01
Add tests and improve checks.
2020-02-17 14:43:38 +01:00
Yuki Okushi
f56e8b7eb4
Rename FunctionRetTy
to FnRetTy
2020-02-17 19:07:08 +09:00
Yuki Okushi
4480ec5b71
Rustup to rust-lang/rust#67953
2020-02-17 11:07:26 +09:00
flip1995
57b636422a
Rustup to rust-lang/rust#68725
2020-02-10 15:59:21 +01:00
bors
b5e6d6db41
Auto merge of #5134 - flip1995:snippet_block, r=phansch
...
Make it possible to correctly indent snippet_block snippets
This adds a `indent_relative_to` arg to the `{snippet,expr}_block` functions. This makes it possible to keep the correct indentation of block like suggestions.
In addition, this makes the `trim_multiline` function private and adds a `indent_of` function, to get the indentation of the first line of a span.
The suggestion of `needless_continue` cannot be made auto applicable, since it would be also necessary to remove code following the linted expression. (Well, maybe it is possible, but I don't know how to do it. Expanding the suggestion span to the last expression, that should be removed didn't work)
changelog: Improve suggestions, when blocks of code are involved
2020-02-06 21:41:50 +00:00
flip1995
9897927504
Rustup to rust-lang/rust#68788
2020-02-06 20:33:39 +01:00
flip1995
250c1842b1
Document the indent_relative_to arg of snippet_block
2020-02-06 19:15:01 +01:00
flip1995
cd0f0946cf
Move tests to the end of the file in utils mod.rs
2020-02-06 19:15:00 +01:00
flip1995
f1a72e992d
Update needless_continue stderr
2020-02-06 19:13:46 +01:00
flip1995
5fd22b3f93
Optionally indent snippet_block relative to an Expr
2020-02-06 19:13:45 +01:00
Areredify
338fb7a3e9
add excessive bools lints
2020-02-05 20:54:58 +03:00
Areredify
8e28b2fdf1
move is_trait_impl_item check from functions.rs to utils
2020-02-05 18:11:20 +03:00
Lzu Tao
32924c6ce0
Few improvement to utils::conf
module
...
* Fix a few typos
* Handle Option<&Path> early
* Use `env::var_os` when possible
2020-02-05 09:06:34 +07:00
Yuki Okushi
f63a6a5baf
Rustup to rust-lang/rust#68133
2020-02-02 06:56:27 +09:00
Areredify
63ab7a5e8c
lint all guard types, not just lock functions
2020-01-30 18:46:22 +03:00