Commit Graph

7798 Commits

Author SHA1 Message Date
Jason Newcomb
3db0e00bdc Lint shadow_* lints in anon const blocks 2022-07-05 15:21:27 -04:00
bors
48e527e4bd Auto merge of #9117 - Jarcho:unsafe_block_closure, r=giraffate
Fix `undocumented_unsafe_blocks` in closures

fixes #9114
changelog: Fix `undocumented_unsafe_blocks` not checking for comments before the start of a closure
2022-07-05 00:20:33 +00:00
Jason Newcomb
975667945c Fix undocumented_unsafe_blocks in closures 2022-07-04 13:53:42 -04:00
Alex Macleod
fec4593082 new_without_default: ignore const generics/lifetime params on fn new 2022-07-04 14:03:11 +00:00
bors
b15f06e74f Auto merge of #9093 - Jarcho:deref_ice, r=giraffate
Fix ICE in `dereference.rs`

fixes #9089
changelog: Fix ICE when dereferencing or borrowing on explicit returns from closures
2022-07-04 00:22:17 +00:00
bors
8c8987749b Auto merge of #9105 - Serial-ATA:lint-invalid-utf8, r=Jarcho
Add `invalid_utf8_in_unchecked`

changelog: Add [`invalid_utf8_in_unchecked`]
closes: #629

Don't know how useful of a lint this is, just saw this was a really old issue 😄.
2022-07-03 20:02:38 +00:00
Serial
de646e10db Add invalid_utf8_in_unchecked 2022-07-03 15:37:30 -04:00
xFrednet
2dd5fc14da
Correct [clippy::version] for 1.62 lints and add note to docs 2022-07-03 17:02:48 +02:00
Jason Newcomb
3e80d3988d Fix ICE in dereference.rs 2022-07-02 00:59:58 -04:00
bors
f30b68d9d6 Auto merge of #9085 - xFrednet:9081-update-format-push-version, r=Manishearth,flip1995
Correct lint version for `format_push_string`

Closes #9081

changelog: none

IDK what else to say. Look I can draw an ascii penguin =D:

```
 (^v^)
<(   )>
  w w
```
2022-07-01 16:51:34 +00:00
xFrednet
a86bf81e44
Correct lint version for format_push_string 2022-07-01 18:05:45 +02:00
Alex Macleod
a5b70a4c1d Fix allow attributes in let_unit_value 2022-07-01 12:14:28 +00:00
Muhammad Hamza
a2b8a67777
Fix broken hyperlink 2022-07-01 00:14:38 +05:00
dAxpeDDa
b7051077c9
Fix false-positive in equatable_if_let 2022-06-30 17:45:34 +02:00
Philipp Krones
9de1f9f45a
Bump Clippy version -> 0.1.64 2022-06-30 10:29:22 +02:00
Philipp Krones
f26cf11fe8
Merge remote-tracking branch 'upstream/master' into rustup 2022-06-30 10:27:25 +02:00
bors
ff3964af1b Auto merge of #9068 - tamaroning:fix-typo-2022-6-30, r=giraffate,xFrednet
fix typo in Clippy Lints page

https://rust-lang.github.io/rust-clippy/master/#significant_drop_in_scrutinee

changelog: none
2022-06-30 06:18:19 +00:00
tamaron
5d9e1b6f00 Update large_const_arrays.rs 2022-06-30 13:21:17 +09:00
tamaron
5d75a9bd4c fix 2022-06-30 11:59:23 +09:00
Jason Newcomb
adbc8499d3 Don't lint while_let_loop when drop order would change 2022-06-29 13:43:05 -04:00
Jason Newcomb
58434ae385 Extract util functions from redundant_pattern_match 2022-06-29 13:42:59 -04:00
bors
90227c10f7 Auto merge of #8981 - PrestonFrom:more_details_for_significant_drop_lint, r=flip1995
Add details about how significant drop in match scrutinees can cause deadlocks

Adds more details about how a significant drop in a match scrutinee can cause a deadlock and include link to documentation.

changelog: Add more details to significant drop lint to explicitly show how temporaries in match scrutinees can cause deadlocks.
2022-06-29 13:23:21 +00:00
bors
4995b4e584 Auto merge of #9046 - xFrednet:rust-97660-expection-something-something, r=Jarcho
Fix `#[expect]` for most clippy lints

This PR fixes most `#[expect]` - lint interactions listed in rust-lang/rust#97660. [My comment in the issue](https://github.com/rust-lang/rust/issues/97660#issuecomment-1147269504) shows the current progress (Once this is merged). I plan to work on `duplicate_mod` and `multiple_inherent_impl` and leave the rest for later. I feel like stabilizing the feature is more important than fixing the last few nits, which currently also don't work with `#[allow]`.

---

changelog: none

r? `@Jarcho`

cc: rust-lang/rust#97660
2022-06-28 18:28:38 +00:00
bors
a4130e1612 Auto merge of #8355 - Jarcho:explicit_auto_deref_2, r=flip1995
Add lint `explicit_auto_deref` take 2

fixes: #234
fixes: #8367
fixes: #8380

Still things to do:

* ~~This currently only lints `&*<expr>` when it doesn't trigger `needless_borrow`.~~
* ~~This requires a borrow after a deref to trigger. So `*<expr>` changing `&&T` to `&T` won't be caught.~~
* The `deref` and `deref_mut` trait methods aren't linted.
* Neither ~~field accesses~~, nor method receivers are linted.
* ~~This probably shouldn't lint reborrowing.~~
* Full slicing to deref should probably be handled here as well. e.g. `&vec[..]` when just `&vec` would do

changelog: new lint `explicit_auto_deref`
2022-06-28 18:09:26 +00:00
Jason Newcomb
ffbba8550a Move SelfAssignment into Operators lint pass 2022-06-28 13:03:08 -04:00
Jason Newcomb
5e2a2d3ac9 Fix dogfood 2022-06-28 13:02:08 -04:00
Jason Newcomb
92891a01a1 Move PtrEq into Operators lin pass 2022-06-28 12:51:30 -04:00
Jason Newcomb
fc5eac5894 Move NeedlessBitwiseBool into Operators lint pass 2022-06-28 12:51:30 -04:00
Jason Newcomb
71c2daa60a Move ModuloArithmetic into Operators lint pass 2022-06-28 12:51:30 -04:00
Jason Newcomb
c0b0ee5bdc Move some lints from Misc to Operators 2022-06-28 12:51:30 -04:00
Jason Newcomb
a8df16ae1d Move IntegerDivision into Operators lint pass 2022-06-28 12:51:30 -04:00
Jason Newcomb
83de67cfec Move IdentityOp into Operators lint pass 2022-06-28 12:51:30 -04:00
Jason Newcomb
56f50d36e7 Move FloatEqualityWithoutAbs into Operators lint pass 2022-06-28 12:51:29 -04:00
Jason Newcomb
3de70a4996 Move ErasingOp into Operators lint pass 2022-06-28 12:51:29 -04:00
Jason Newcomb
0adb3c0518 Move EqOp into Operators lint pass 2022-06-28 12:51:29 -04:00
Jason Newcomb
732d7162ab Move DurationSubsec into Operators lint pass 2022-06-28 12:51:29 -04:00
Jason Newcomb
4ac3626f2e Move DoubleComparison into Operators lint pass 2022-06-28 12:51:29 -04:00
Jason Newcomb
68a7fd22ad Move BitMask into Operators lint pass 2022-06-28 12:51:26 -04:00
Jason Newcomb
751131b4ac Move AssignOps into Operators lint pass 2022-06-28 12:51:03 -04:00
Jason Newcomb
448b6f45bd Move Arithmetic into Operators lint pass 2022-06-28 12:51:00 -04:00
Jason Newcomb
dd78ce7bbe Add Operators lint pass 2022-06-28 12:50:33 -04:00
Jason Newcomb
15df2289ea Code cleanup 2022-06-28 12:48:49 -04:00
Jason Newcomb
9788107931 Handle future precedence issues in explicit_auto_deref + cleanup 2022-06-28 12:48:27 -04:00
Jason Newcomb
6d21b79be9 Fix needless_borrow suggestion when calling a trait method taking self 2022-06-28 12:48:27 -04:00
Jason Newcomb
0b4ba734cb Refactor dereference.rs
Merge `Position` and `AutoDerefStability`
2022-06-28 12:48:26 -04:00
Jason Newcomb
0204b95357 Lint explicit_auto_deref immediately after needless_borrow 2022-06-28 12:48:26 -04:00
Jason Newcomb
65bc6cb8bf Lint explicit_auto_deref without a leading borrow 2022-06-28 12:48:26 -04:00
Jason Newcomb
442a68c64b Only check parent node once in dereference.rs 2022-06-28 12:48:26 -04:00
Jason Newcomb
20ea26234a Lint field accesses in explicit_auto_deref 2022-06-28 12:48:26 -04:00
Jason Newcomb
a187d6412b Merge different parent walking loops in dereference.rs
`needless_borrow` will now walk further to find the target type.
2022-06-28 12:48:26 -04:00