Commit Graph

81 Commits

Author SHA1 Message Date
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 Hansch
870ae36f85
Cleanup: Rename 'db' variable to 'diag' 2020-04-17 08:08:00 +02:00
Philipp Hansch
31c5664f25
Cleanup: Use our sym! macro more
It's much shorter that Symbol::intern and the result should still be
clear.
2020-04-13 08:57:34 +02:00
Matthias Krüger
aff57e0f43 rustup https://github.com/rust-lang/rust/pull/70536 2020-03-30 11:17:58 +02:00
Philipp Hansch
cec1e8f74e
Remove dependency on matches crate
The std equivalent works exactly the same.
2020-03-25 07:50:08 +01:00
flip1995
21aeb21b8a
Rustup to rust-lang/rust#66131 2020-03-19 14:33:10 +01:00
Matthias Krüger
2204bf20ae clean up a few lint docs 2020-03-18 02:50:39 +01:00
flip1995
8472ecda0f
Fix fallout 2020-02-21 11:14:18 +01:00
Yuki Okushi
ce1c6b285d Rustup to rust-lang/rust#68045 2020-01-13 21:55:57 +09:00
Yuki Okushi
39947992b5 Rustup to rust-lang/rust#67806 2020-01-11 21:50:00 +09:00
Yuki Okushi
2f2eaf8b7e Rustup to rust-lang/rust#67886 2020-01-07 01:46:33 +09:00
Yuki Okushi
9086b17e14 Rustup to rust-lang/rust#67707 2019-12-31 09:17:56 +09:00
Yuki Okushi
e2636729ec Rustup to rust-lang/rust#66936 2019-12-27 16:13:53 +09:00
Lzu Tao
652666b288 rustup "Add span information to ExprKind::Assign" 2019-12-24 11:25:24 +07:00
Matthias Krüger
98e433d70d
Rustup to rust-lang/rust#66878 2019-12-04 01:34:01 +01:00
flip1995
aa2381d9d0
Fix rustdoc examples 2019-12-03 16:29:05 +01:00
flip1995
1e3b24de43
Make manual_swap autofixable 2019-12-03 13:42:05 +01:00
flip1995
bd39a608a8
Formatting 2019-12-03 13:25:41 +01:00
flip1995
d1d5f790f5
Fix FP in manual_swap lint with slice-like types 2019-12-03 13:25:41 +01:00
flip1995
4bbd10a585
Rustup to rust-lang/rust#64813 2019-09-27 17:21:20 +02:00
Lzu Tao
a7b7e19f49 Rustup https://github.com/rust-lang/rust/pull/64513 2019-09-26 16:03:36 +07:00
bors
6ca5b2053a Auto merge of #4478 - tsurai:master, r=flip1995
Fix incorrect swap suggestion

Clippy suggests using swap on fields belonging to the same owner causing two mutable borrows of the owner.

Disclosure: This is my first time working with clippy and rusts HIR. I'm very grateful for assistance and suggestions to improve the PR.

fixes #981
changelog: Fix false positive in `manual_swap` lint
2019-09-11 09:48:25 +00:00
Matthias Krüger
b72982759c run rustfmt 2019-09-11 08:26:57 +02:00
Andre Bogus
e3c4ffd4aa Use diagnostic item for 2019-09-09 05:43:39 +02:00
Cristian Kubis
8bc1ded805 Fix incorrect swap suggestion
Clippy suggests using swap on fields belonging to the same owner
causing two mutable borrows of the owner

Fixes #981

Signed-off-by: Cristian Kubis <cristian.kubis@tsunix.de>
2019-08-31 18:53:14 +02:00
BO41
43a2ba34e6 Add examples to some correctness lints 2019-08-22 15:41:07 +02:00
Philipp Hansch
abfa8a952c
Doctests: Fix all complexity lint docs
cc #4319
2019-08-02 18:16:35 +02:00
Oliver Scherer
f7f85a0dca Prevent symbocalypse 2019-05-17 23:53:54 +02:00
Oliver Scherer
b2dbda4d48 Use symbols instead of strings 2019-05-14 10:33:42 +02:00
Matthew Kraai
753c39672e Use lint pass macros
Fixes #3917.
2019-04-17 09:35:22 -07: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
Andy Russell
fe96ffeac9
move lint documentation into macro invocations 2019-03-05 18:45:08 -05:00
Michael Wright
c02367c4e9 Fix breakage due to rust-lang/rust#58079
The rustc change added HirId to a few nodes. As I understand it, the plan is
to remove the NodeId from these nodes eventually. Where the NodeId was
not being matched, I used `..` to try and avoid further breakage. Where it
was, I used `_` to make the fix easier when NodeId is removed.
2019-02-03 09:12:07 +02:00
Matthias Krüger
3a96d6b603 rustup https://github.com/rust-lang/rust/pull/57907/
for file in `fd \.rs$` ; do sed  -i  s/span_suggestion_with_applicability/span_suggestion/g $file ; done

for file in `fd \.rs$` ; do sed  -i  s/span_suggestion_short_with_applicability/span_suggestion_short/g $file ; done

for file in `fd \.rs$` ; do sed  -i  s/span_suggestions_with_applicability/span_suggestions/g $file ; done
2019-01-27 13:33:56 +01:00
Matthias Krüger
e9e0a7e3bd rustup https://github.com/rust-lang/rust/pull/57726 2019-01-27 01:42:34 +01:00
Michael Wright
f51f0178dd Fixed breakage due to rust-lang/rust#57489 2019-01-20 12:21:30 +02:00
Philipp Hansch
38d4ac7cea
Remove all copyright license headers
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
2019-01-08 21:46:39 +01:00
Konrad Borowski
3f62fc3a7e Remove crate:: prefixes from crate paths
This is somewhat misleading, as those are actually external crates,
and don't need a crate:: prefix.
2018-12-29 16:05:49 +01:00
flip1995
1751d2496d
Run rustfmt on clippy_lints 2018-11-27 21:14:15 +01:00
Manish Goregaokar
e9c025ea70 Add license header to Rust files 2018-10-06 09:43:08 -07:00
Vitaly _Vi Shukela
58729346be
Fill in Applicability from review comments by @flip1995 2018-09-20 14:38:48 +02:00
Vitaly _Vi Shukela
3eccccb367
Fix indents 2018-09-20 14:38:48 +02:00
Vitaly _Vi Shukela
92034e20c8
Use span_suggestion_with_applicability instead of span_suggestion 2018-09-20 14:38:47 +02:00
flip1995
021748eb6a
Replace another occurrence of "".to_owned() 2018-09-15 11:25:40 +02:00
Matthias Krüger
f3add4acb4
convert "".to_string() and "".to_owned() to String::new() 2018-09-15 11:20:35 +02:00
Eduard-Mihai Burtescu
9219fc6c5c Reintroduce extern crate for non-Cargo dependencies. 2018-09-15 11:10:51 +03:00
flip1995
8c07772dbb Switch to declare_tool_lint macro 2018-08-29 11:08:29 -07:00
Oliver Schneider
d99cea0f16 Update imports and rustup 2018-08-28 13:13:42 +02:00
Matthias Krüger
f7be2a0416 add how-to example for std::mem::transmute() usage instead of manual swap 2018-08-24 18:41:49 +02:00
Matthias Krüger
712d2d4fa1 rustup, fix breakage introduced by https://github.com/rust-lang/rust/pull/53581 2018-08-22 23:34:52 +02:00