Commit graph

6441 commits

Author SHA1 Message Date
Matthias Kaak
7c82e78f30 improved help message for suspicious_map 2021-10-05 19:09:08 +00:00
hkalbasi
388a3d0983 Implement equatable if let lint 2021-10-04 22:16:42 +03:30
Takayuki Nakata
72f0180f7b Fix ICE in implicit_hasher 2021-10-04 23:31:40 +09:00
bors
63b04f7d7f Auto merge of #7755 - HKalbasi:master, r=xFrednet
exclude enum from derivable impls

fix #7753

changelog: Exclude enum from ``[`derivable_impls`]``
2021-10-03 10:30:16 +00:00
HKalbasi
0ebc656a9a
Change not enum to is struct 2021-10-03 13:01:57 +03:30
hkalbasi
ea8e65f0da exclude enum from derivable impls 2021-10-03 11:58:27 +03:30
Yechan Bae
fb0353b28d Update documentation and name for non_send_fields_in_send_ty lint 2021-10-02 19:22:37 -04:00
Yechan Bae
dfed2e31d5 Do not use full type path in help message 2021-10-01 14:04:20 -04:00
Yechan Bae
4f01656a7d Add ui-test for enable-raw-pointer-heuristic-for-send config 2021-10-01 14:04:20 -04:00
Yechan Bae
08f0aecffd Minor changes from PR feedback 2021-10-01 14:04:20 -04:00
Yechan Bae
427a09ba7b Add configuration for raw pointer heuristic 2021-10-01 14:04:20 -04:00
Yechan Bae
d413e157a5 Look into tuple, array, ADT args in raw pointer heuristic 2021-10-01 14:04:20 -04:00
Yechan Bae
ee74574876 Emit one report for all fields in the same ADT 2021-10-01 14:04:20 -04:00
Yechan Bae
a81a5ad1a8 Update documentation 2021-10-01 14:04:20 -04:00
Yechan Bae
6458630e1a typo 2021-10-01 14:04:20 -04:00
Yechan Bae
d7a9ec2c50 Fix attribute handling 2021-10-01 14:04:20 -04:00
Yechan Bae
e4c3000e5b Initial implementation 2021-10-01 14:04:20 -04:00
bors
fe999e88ed Auto merge of #7741 - surechen:fix_if_then_panic, r=flip1995
Make if_then_panic handle situation of BinOpKind::And || BinOpKind::Or

fixes #7731

Make if_then_panic handle situation of cond.kind = ExprKind::DropTemps(ExprKind::Binary(BinOpKind::And || BinOpKind::Or, left, right), ..) =

changelog: [`if_then_panic`] Fix suggestion for more complex conditions
2021-10-01 10:04:19 +00:00
surechen
41e2c68a6e use sugg::Sugg::maybe_par 2021-10-01 13:13:09 +08:00
Cameron Steffen
8c0e4d5ccf Rewrite shadow lint 2021-09-30 14:07:58 -05:00
Cameron Steffen
99861c0e88 Remove initialization note from shadow lint 2021-09-30 13:54:30 -05:00
Cameron Steffen
89f77f3512 Move shadow_unrelated to restriction 2021-09-30 13:54:28 -05:00
bors
a893eb993b Auto merge of #7677 - surechen:edit_large_enum_variant, r=camsteffen
fix bug for large_enum_variants

Fix the discussion problem in the issue of https://github.com/rust-lang/rust-clippy/issues/7666#issuecomment-919654291

About the false positive problem of case:
```rust
enum LargeEnum6 {
    A,
    B([u8;255]),
    C([u8;200]),
}
```

changelog: Fix largest_enum_variant wrongly identifying the second largest variant.
2021-09-30 12:45:17 +00:00
surechen
4babfae9cb fix issue #7731
Make if_then_else handle situation of cond.kind = ExprKind::DropTemps(ExprKind::Binary(BinOpKind::And || BinOpKind::Or, left, right), ..) =
2021-09-30 19:06:42 +08:00
surechen
56f0c9afdd fix bug for large_enum_variants 2021-09-30 10:07:57 +08:00
Michael Wright
e6747df5cd Fix lint register code format
Also change the generation functions to return `String` instead of
`Vec<String>`. This makes sense now as the updates aren't line oriented
anymore.
2021-09-29 05:46:39 +02:00
Michael Wright
50ea370619 Move code generated by update_lints to includes 2021-09-29 05:43:25 +02:00
vxpm
30ea0a5ebb
Fix typo ("asynx" corrected to "async") 2021-09-28 17:53:12 -03:00
bors
fb17671eb0 Auto merge of #7734 - Manishearth:doc-unsafe-trait, r=camsteffen
Make `doc_unsafe` warn on unsafe traits as well

Fixes #7732

changelog: Make [`doc_unsafe`] warn on unsafe traits as well
2021-09-28 17:09:34 +00:00
bors
cb7915b00c Auto merge of #7733 - flip1995:rustup, r=flip1995
Rustup

This needs a review this time. Especially 521bf8f0fa cc `@camsteffen` I think this is necessary now, because `itertools` is no longer a dependency of `clippy_utils` and therefore this path can't be found 🤔

( I forgot about the sync last week. I should get to document this process better, so other people can do it when I'm not around )

changelog: none
2021-09-28 16:42:31 +00:00
flip1995
c2b8882cef
Cleanup of rustup changes 2021-09-28 17:40:06 +01:00
flip1995
d8f453d021
Bump nightly version -> 2021-09-28 2021-09-28 17:39:16 +01:00
Manish Goregaokar
53c534d11b Update clippy_lints/src/doc.rs
Co-authored-by: Cameron Steffen <cam.steffen94@gmail.com>
2021-09-28 09:37:58 -07:00
flip1995
ec38746b4a
Allow internal lint INVALID_PATHS for itertools path
Since clippy_utils doesn't depend on the itertools crate anymore, the
lint can't find the path.
2021-09-28 17:07:51 +01:00
Manish Goregaokar
25850fc264 Make doc_unsafe lint on unsafe traits as well 2021-09-28 08:40:59 -07:00
flip1995
707494eca9
Merge remote-tracking branch 'upstream/master' into rustup 2021-09-28 10:52:31 +01:00
Manish Goregaokar
13834e6ad2 fmt 2021-09-27 22:33:45 -07:00
Manish Goregaokar
17155c8dca Add renamed lint 2021-09-27 22:26:14 -07:00
Manish Goregaokar
baec67e9de Use a single if_chain 2021-09-27 22:23:17 -07:00
Andrew Pollack
b7d40bc103 Adding new linting 2021-09-27 22:23:17 -07:00
bors
0c8799da5a Auto merge of #7664 - matthiaskrgr:bump_to_2021, r=flip1995
bump clippy crates to edition 2021

Also helps with dogfooding edition 2021 a bit. :)
Tests passed locally.

---

changelog: bump edition from 2018 to 2021
2021-09-27 09:14:10 +00:00
bors
f100159f8c Auto merge of #7692 - workingjubilee:float-cmp-not-wrong, r=giraffate
Demote float_cmp to pedantic

See this issue: https://github.com/rust-lang/rust-clippy/issues/7666

This is one of the most frequently suppressed lints. It is deny-by-default. It is not actually clearly wrong, as there are many instances where direct float comparison is actually desirable. It is only after operating on floats that they may lose precision, and that depends greatly on the operation. As most correctness lints have a much higher standard of error, being based on hard and fast binary logic, this should not be amongst them.

A linter is not a substitute for observing the math carefully and running tests, and doing the desirable thing is even more likely to lead one to want exact comparisons.

changelog: Demote [`float_cmp`] from correctness to pedantic lints
2021-09-27 09:00:31 +00:00
David Tolnay
e63d69244e
Stop suggesting a float truncation that is not shorter 2021-09-25 22:55:23 -07:00
Manish Goregaokar
067bfe3618 Rollup merge of #89216 - r00ster91:bigo, r=dtolnay
Consistent big O notation

This makes the big O time complexity notation in places with markdown support more consistent.
Inspired by #89210
2021-09-25 18:22:20 -07:00
Matthias Krüger
d888b4b98c clippy lints: update doctest ranges to inclusive ones 2021-09-25 22:40:58 +02:00
Matthias Krüger
c3515c301d bump clippy crates to edition 2021 2021-09-25 22:40:58 +02:00
Jubilee
e0b68ae6c0 Rollup merge of #89001 - jackh726:binder-cleanup, r=nikomatsakis
Be explicit about using Binder::dummy

This is somewhat of a late followup to the binder refactor PR. It removes `ToPredicate` and `ToPolyTraitImpls` that hide the use of `Binder::dummy`. While this does make code a bit more verbose, it allows us be more careful about where we create binders.

Another alternative here might be to add a new trait `ToBinder` or something with a `dummy()` fn. Which could still allow grepping but allows doing something like `trait_ref.dummy()` (but I also wonder if longer-term, it would be better to be even more explicit with a `bind_with_vars(ty::List::empty())` *but* that's not clear yet.

r? ``@nikomatsakis``
2021-09-24 11:40:11 -07:00
bors
fb61d04896 Auto merge of #7669 - Labelray:if_then_panic, r=giraffate
New lint `if_then_panic`

changelog: add the new lint [`if_then_panic`]
fix #7645
2021-09-24 14:43:51 +00:00
Labelray
543b638dbe Add new lint if_then_panic 2021-09-24 22:14:20 +08:00
r00ster91
7355376d5b consistent big O notation 2021-09-24 12:44:28 +02:00