Commit graph

2423 commits

Author SHA1 Message Date
bors
3d31c2157a Auto merge of #3794 - mikerite:fix-3739, r=phansch
Fix `boxed_local` suggestion

Don't warn about an argument that is moved into a closure.

ExprUseVisitor doesn't walk into nested bodies so use a new
visitor that collects the variables that are moved into closures.

Fixes #3739
2019-03-12 07:43:14 +00:00
bors
75bfa29533 Auto merge of #3871 - taiki-e:needless_continue, r=phansch
Fix `needless_continue` false positive

If the `continue` has a label, check it matches the label of the loop.

Fixes https://github.com/rust-lang/rust-clippy/issues/2329
2019-03-12 07:04:44 +00:00
bors
b586d76b43 Auto merge of #3865 - phansch:run_more_doc_tests, r=flip1995
Run more doc tests

This executes some more doc tests that were ignored before.
2019-03-12 06:22:00 +00:00
Michael Wright
6937d5581a Merge branch 'master' into fix-3739 2019-03-12 08:13:44 +02:00
Philipp Hansch
9ca34e37fa
Run more doc tests
This executes some more doc tests that were ignored before.
2019-03-12 06:53:25 +01:00
Taiki Endo
1bc7da2fec Fix needless_continue false positive 2019-03-12 03:40:30 +09:00
Taiki Endo
4896b259eb Filter out proc_macro and proc_macro_attribute 2019-03-11 20:45:57 +09:00
flip1995
72aeaa891b
Fix/Ignore doc tests 2019-03-10 23:01:56 +01:00
flip1995
44c46d2059
Run rustfmt 2019-03-10 22:12:26 +01:00
Alexander Regueiro
d2b85323ad Addressed points raised in review. 2019-03-10 18:06:28 +00:00
Alexander Regueiro
d43966a176 Various cosmetic improvements. 2019-03-10 18:06:28 +00:00
Manish Goregaokar
038ec7f5d8 Move get_unwrap to restriction
fixes #3862
2019-03-09 13:48:06 -08:00
bors
ccfbfb8097 Auto merge of #3860 - phansch:refactor_out_opt_def_id, r=flip1995
Refactor: Remove utils::opt_def_id

This removes some indirection. Probably this method was uplifted to
rustc at some point?
2019-03-09 12:05:41 +00:00
Philipp Krones
c32135a87f
Rollup merge of #3857 - phansch:document_path_qpath, r=flip1995
Document match_path, improve match_qpath docs

Inching towards enabling `#[deny(missing_docs)]` in utils 📜
2019-03-09 12:24:44 +01:00
Philipp Krones
f69351e995
Rollup merge of #3852 - phansch:refactor_assign_ops, r=flip1995
Refactor: Cleanup one part of assign_ops lint

Removes a lot of indentation and separates lint emission from lint
logic. Only touches the `hir::ExprKind::AssignOp` part of the lint.
2019-03-09 12:24:43 +01:00
Philipp Krones
1902384d15
Rollup merge of #3851 - phansch:refactor_trait_stuff, r=flip1995
Refactor: Extract `trait_ref_of_method` function

This pattern was used in three places after #3844, so I think it's worth moving it into `utils/mod.rs` and documenting it.
2019-03-09 12:24:42 +01:00
Philipp Hansch
9d97ed6faa
Refactor: Remove utils::opt_def_id
This removes some indirection. Probably this method was uplifted to
rustc at some point?
2019-03-08 14:14:41 +01:00
Philipp Hansch
f04acdd463
Document match_path, improve match_qpath docs 2019-03-08 09:50:20 +01:00
Philipp Hansch
9494f22f06
cargo fmt 2019-03-08 09:44:22 +01:00
Philipp Hansch
131b89b54e
fmt 2019-03-08 09:43:36 +01:00
Philipp Krones
837d675afd
Update clippy_lints/src/utils/mod.rs
Co-Authored-By: phansch <dev@phansch.net>
2019-03-08 09:40:12 +01:00
Philipp Hansch
65694cc6c8
Fix doctest 2019-03-08 09:10:41 +01:00
Philipp Hansch
5c9221f880
Refactor: Cleanup one part of assign_ops lint
Removes a lot of indentation and separates lint emission from lint
logic. Only touches the `hir::ExprKind::AssignOp` part of the lint.
2019-03-08 09:01:29 +01:00
ljedrz
5d78250c75 align with rust-lang/rust/#58992 2019-03-07 21:51:05 +01:00
rchaser53
ae787d954e fix missing a semicolon 2019-03-07 23:26:47 +09:00
Philipp Hansch
e1d47cd5f1
Refactor: Extract trait_ref_of_method function 2019-03-07 08:17:43 +01:00
Félix Fischer
ddc718087f Renamed: Cyclomatic Complexity -> Cognitive Complexity
* Ran automatic naming update

* Formalized rename of `cyclomatic_complexity` to `cognitive_complexity`
** Added the rename to `lib.rs`
** Added rename test

* Added warning for deprecated key `cyclomatic_complexity_threshold` and tests for it

* Added deprecation status for Clippy's builtin attribute

* Updated tests for new builtin attribute renaming
2019-03-06 10:07:38 -03:00
Andy Russell
a9de64a151
fix or ignore failing doc tests 2019-03-05 18:45:08 -05:00
Andy Russell
fe96ffeac9
move lint documentation into macro invocations 2019-03-05 18:45:08 -05:00
Philipp Hansch
15cba2e956
Fix missing_const_for_fn for impl trait methods 2019-03-05 08:11:55 +01:00
Philipp Hansch
b87f5bc55a
Don't trigger missing_const_for_fn in external macros
As reported in #3841. Only fixes the part where it triggers on the
`derive`.
2019-03-04 22:56:33 +01:00
Philipp Hansch
68096cf181
fmt fixes 2019-03-03 13:05:39 +01:00
ljedrz
f3363b9cf2 align with rust-lang/rust/#58836 2019-03-01 19:10:14 +01:00
ljedrz
f2587703cc enable rust-lang/rust#58754 2019-03-01 19:10:14 +01:00
Santiago Pastorino
77a67c914d
Place::Local(x) is now Place::Base(PlaceBase::Local(x)) 2019-03-01 12:20:17 -03:00
flip1995
1463d6f69f
Error an unknown or deprecated Clippy attribute 2019-02-28 16:44:42 +01:00
bors
ff2798840c Auto merge of #3666 - detrumi:map-or-on-non-copy, r=flip1995
Only suggest map_or for copy types

Fixes #2686
2019-02-27 08:28:48 +00:00
Philipp Hansch
982a99d2c4
Rustup https://github.com/rust-lang/rust/pull/58321 2019-02-27 07:20:49 +01:00
bors
6e8931c5f5 Auto merge of #3821 - g-bartoszek:redundant_closure-different-borrow-levels, r=oli-obk
do not trigger redundant_closure when there is a difference in borrow…

… level between closure parameter and "self", fixes  #3802
2019-02-26 17:30:48 +00:00
Wilco Kusee
eb70a72459
Fix false negative 2019-02-26 17:29:36 +01:00
Wilco Kusee
fec6e55d1d
Attempt to fix false negative 2019-02-26 17:27:41 +01:00
Wilco Kusee
4cf720abbe
Move lint_map_unwrap_or to its own file 2019-02-26 17:27:41 +01:00
Wilco Kusee
54ab22f6db
Only suggest map_or for copy types 2019-02-26 17:27:40 +01:00
bors
0957f7d3b7 Auto merge of #3817 - rust-lang:fix-bool_comparison-on-non-bool, r=oli-obk
Fix `bool_comparison` with non-`bool` expressions

Fixes #3703.
It just moves around the type check that was already there for some comparison to all of them, because if one type isn't `bool`, none of those comparison can be simplified.
2019-02-26 15:51:40 +00:00
Grzegorz
a7f4d41a7d do not trigger redundant_closure when there is a difference in borrow level between closure parameter and "self" 2019-02-26 12:12:27 +01:00
bors
412d41ae86 Auto merge of #3814 - ljedrz:HirIdification_lockstep_upgrade, r=phansch
HirIdify some lints

Unblocks https://github.com/rust-lang/rust/pull/58561 (a part of [rust-lang/rust#57578](https://github.com/rust-lang/rust/pull/57578)). Can we branch it like with https://github.com/rust-lang/rust-clippy/pull/3790? I can rebase on a different commit if need be.

Haven't had time to run tests yet, so I'd wait for Travis 🙈.
2019-02-26 10:43:50 +00:00
ljedrz
c1b65ec363 fix line format 2019-02-26 11:21:07 +01:00
Michael Wright
c9d79c0c5e Remove #[feature(try_from)]
`try_from` is now stable.
2019-02-26 08:43:47 +02:00
mcarton
c0c0686a65 Fix bool_comparison with non-bool expressions 2019-02-25 22:31:16 +01:00
bors
50d9473856 Auto merge of #3808 - mikerite:useless-format-suggestions, r=oli-obk
Fix `useless_format` suggestions
2019-02-25 16:21:26 +00:00