Lukas Lueg
657b0da912
Add partialeq_to_none lint
...
Fixes #9275
2022-08-08 20:17:13 +02:00
bors
71777465cc
Auto merge of #9284 - lengyijun:typo, r=dswij
...
fix typo in tests/ui/redundant_allocation.rs
changelog: none
2022-08-03 10:33:45 +00:00
lengyijun
b50ba06a83
fix typo in tests/ui/redundant_allocation.rs
2022-08-03 04:57:36 +00:00
Daniel Macovei
503c03c558
clean up
2022-08-02 12:06:22 -05:00
Daniel Macovei
145ebb1cd7
add paren before '?' when suggesting deref
2022-08-02 10:39:35 -05:00
bors
05e7d5481b
Auto merge of #9053 - AaronC81:fix-9052, r=flip1995
...
Fix suggestions for `async` closures in redundant_closure_call
Fixes #9052
changelog: Fix suggestions given by [`redundant_closure_call`] for async closures
2022-08-02 12:39:37 +00:00
bors
00e59cdad0
Auto merge of #9264 - guerinoni:instant-elapsed, r=Alexendoo
...
Add `elapsed_instant` lint
Closes #8603
- \[x] Followed [lint naming conventions][lint_naming]
- \[x] Added passing UI tests (including committed `.stderr` file)
- \[x] `cargo test` passes locally
- \[x] Executed `cargo dev update_lints`
- \[x] Added lint documentation
- \[x] Run `cargo dev fmt`
---
changelog: [`elapsed_instant`]: Add lint
2022-08-02 11:16:47 +00:00
bors
367d09fc4e
Auto merge of #9254 - alex-semenyuk:enable_empty_loop_no_std_on_windows, r=dswij
...
Enable test empty_loop_no_std on windows
Verified that it actully works on windows
changelog: none
2022-08-02 06:44:03 +00:00
Federico Guerinoni
0696624ba7
Add elapsed_instant
lint
...
Closes #8603
Signed-off-by: Federico Guerinoni <guerinoni.federico@gmail.com>
2022-08-01 23:39:00 +02:00
bors
a5a6c95da8
Auto merge of #9273 - tabokie:assert_ok_fp, r=flip1995
...
Move [`assertions_on_result_states`] to restriction
Close #9263
This lint causes regression on readability of code and log output. And printing runtime values is not particularly useful for majority of tests which should be reproducible.
changelog: Move [`assertions_on_result_states`] to restriction and don't lint it for unit type
Signed-off-by: tabokie <xy.tao@outlook.com>
2022-08-01 12:16:45 +00:00
tabokie
48ad9d8bc7
do not apply [assertions_on_result_states
] to unwrap unit type
...
Signed-off-by: tabokie <xy.tao@outlook.com>
2022-08-01 20:13:33 +08:00
bors
a591e725a6
Auto merge of #9223 - sgued:unwrap-expect-used, r=giraffate
...
unwrap_used: Don't recommend using `expect` when the `expect_used` lint is not allowed
Fixes #9222
```
changelog: [`unwrap_used`]: Don't recommend using `expect` when the `expect_used` lint is not allowed
```
2022-08-01 01:27:03 +00:00
Andy Caldwell
66b46749e6
Change lint name to plural
2022-07-29 19:35:39 +01:00
Andy Caldwell
2f48257cfb
Rename "blacklisted name" to "disallowed name" throughout
2022-07-29 19:35:18 +01:00
Philipp Krones
0905ec465d
Merge remote-tracking branch 'upstream/master' into rustup
2022-07-28 18:55:32 +02:00
alex-semenyuk
38e80132d5
Enable test empty_loop_no_std on windows
2022-07-28 10:57:01 +03:00
bors
d72e5f2e10
Auto merge of #9241 - Jarcho:ice_9238, r=xFrednet
...
Fix ICE in `miri_to_const`
fixes #9238
changelog: Fix ICE when using `#![feature(generic_const_exprs)]` in various lints
2022-07-25 22:14:55 +00:00
bors
8882578a67
Auto merge of #9130 - c410-f3r:arith, r=llogiq
...
Add `Arithmetic` lint
Fixes https://github.com/rust-lang/rust-clippy/issues/8903
r? `@llogiq`
changelog: Add `Arithmetic` lint
2022-07-25 21:26:15 +00:00
bors
c76db5c04e
Auto merge of #9243 - Jarcho:std_core, r=Manishearth
...
Don't lint `std_instead_of_core` on `std::env`
fixes #9239
This also reorders the execution of the lint to do as little as possible in the case where the path doesn't start with `std` or `alloc`.
changelog: [`std_instead_of_core`](https://rust-lang.github.io/rust-clippy/master/#std_instead_of_core ): Don't lint on `use std::env`
changelog: [`std_instead_of_alloc`](https://rust-lang.github.io/rust-clippy/master/#std_instead_of_alloc ): Don't lint `use std::vec` twice
2022-07-25 15:19:41 +00:00
bors
1cce0477e4
Auto merge of #9225 - tabokie:assert_ok, r=Jarcho
...
add `[assertions_on_result_states]` lint
Close #9162
changelog: add `[assertions_on_result_states]` lint
Signed-off-by: tabokie <xy.tao@outlook.com>
2022-07-25 15:00:27 +00:00
tabokie
8454602cef
Add [assertions_on_result_states]
lint
...
Signed-off-by: tabokie <xy.tao@outlook.com>
2022-07-25 22:42:41 +08:00
bors
a14edd571e
Auto merge of #9246 - kyoto7250:reopen_issue_8493, r=Jarcho
...
check macro statements in `[non_copy_const]`
close #8493
close #9224
This PR fixes false positives in `[non_copy_const]`.
changelog: fix false positives in`[non_copy_const]`
---
r? `@Jarcho`
2022-07-25 14:26:27 +00:00
kyoto7250
b6c301055e
fixed tests to not use tokio
2022-07-25 23:04:18 +09:00
kyoto7250
477356460b
check macro statements in non_copy_const.rs
2022-07-25 22:28:49 +09:00
Jason Newcomb
6bc024df18
Improve [std|alloc]_instead_of_[alloc|core]
lints
...
* Don't call `TyCtxt::crate_name` unless necessary
* Don't lint on `use std::env`
* Only lint once on `use std::vec`
2022-07-24 23:15:39 -04:00
Jason Newcomb
2255cfd2ab
Fix ICE in question_mark
2022-07-24 23:12:29 -04:00
Jason Newcomb
ab6463e9d9
Fix ICE in miri_to_const
2022-07-24 18:23:33 -04:00
Alex Macleod
d60d5e8bde
Fix useless_format
spans for format!("{foo}")
2022-07-24 16:47:17 +00:00
Michael Goulet
632f9945d6
Do not resolve associated const when there is no provided value
2022-07-22 18:58:07 +00:00
Sosthène Guédon
3e52031471
unwrap_used: Fix help, "an None
" -> "None
"
2022-07-22 19:14:58 +02:00
Sosthène Guédon
6ee03e2b01
unwrap_used: Stop recommending using expect
when the expect_used
lint is not allowed
2022-07-21 22:50:54 +02:00
bors
05a51e5730
Auto merge of #9214 - Jarcho:assign_op_prim, r=Manishearth
...
Check `assign_op_pattern` for conflicting borrows
fixes #9180
changelog: [`assign_op_pattern`](https://rust-lang.github.io/rust-clippy/master/#assign_op_pattern ): Don't lint when the suggestion would cause borrowck errors.
2022-07-21 17:00:40 +00:00
bors
fa3c293db4
Auto merge of #9215 - alex-semenyuk:enable_test_entrypoint_recursion, r=Jarcho
...
Enable test for entrypoint_recursion for windows
Verified that this test actually works on windows
changelog: none
2022-07-21 15:45:50 +00:00
alex-semenyuk
27d49b08d5
Enable test for entrypoint_recursion for windows
2022-07-20 21:41:12 +03:00
Jason Newcomb
a2f9b93116
Don't lint assign_op_pattern
when the suggestion would cause borrowck errors
2022-07-20 10:23:07 -04:00
bors
7c8e1bff90
Auto merge of #9207 - Jarcho:todo_arm, r=giraffate
...
Check for `todo!` on every expression in `SpanlessEq`
fixes #9204
changelog: [`match_same_arms`](https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms ): Don't lint on arms with `todo!`
2022-07-20 01:38:00 +00:00
Evan Typanski
40340745a8
Use parens around [needless_borrow
] field calls
2022-07-19 15:17:24 -04:00
Jason Newcomb
95c759157c
Check for todo!
on every expression in SpanlessEq
2022-07-19 09:57:18 -04:00
Michael Goulet
30a9533570
Mention first and last macro in backtrace
2022-07-19 03:07:54 +00:00
Caio
31e5465f8a
Add Arithmetic lint
2022-07-18 14:29:45 -03:00
bors
cce617165d
Auto merge of #9148 - arieluy:then_some_unwrap_or, r=Jarcho
...
Add new lint `obfuscated_if_else`
part of #9100 , additional commits could make it work with `then` and `unwrap_or_else` as well
changelog: Add new lint `obfuscated_if_else`
2022-07-18 12:45:11 +00:00
bors
bf70865cf4
Auto merge of #9199 - Xiretza:unused-self-exported-api, r=Jarcho
...
unused_self: respect avoid-breaking-exported-api
```
changelog: [`unused_self`]: Now respects the `avoid-breaking-exported-api` config option
```
Fixes #9195 .
I mostly copied the implementation from `unnecessary_wraps`, since I don't have much understanding of rustc internals.
2022-07-18 12:29:22 +00:00
bors
f4c9183531
Auto merge of #9146 - arieluy:type_params, r=dswij
...
Fix `mismatching_type_param_order` false positive
changelog: Don't lint `mismatching_type_param_order` on complicated generic params
fixes #8962
2022-07-18 10:13:39 +00:00
Xiretza
7a5965b459
unused_self: respect avoid-breaking-exported-api
2022-07-18 10:57:08 +02:00
Philipp Krones
7d4daaa8fa
Merge commit 'fdb84cbfd25908df5683f8f62388f663d9260e39' into clippyup
2022-07-18 09:39:37 +02:00
Ariel Uy
9ff7c91100
Add new lint obfuscated_if_else
...
New lint suggests using `if .. else ..` instead of
`.then_some(..).unwrap_or(..)`.
2022-07-17 18:44:49 -07:00
Ariel Uy
8cf39a8c19
Fix mismatching_type_param_order
false positive
...
Previously was giving false positive when an impl had a nontrivial
generic argument such as a tuple. Don't lint on these cases.
2022-07-17 11:23:09 -07:00
Caio
f88a1399bb
Stabilize let_chains
2022-07-16 20:17:58 -03:00
Aaron Christiansen
4c43aa7053
Fix suggestion for async
in redundant_closure_call
...
Fix redundant_closure_call for single-expression async closures
Add Sugg::asyncify
Use Sugg for redundant_closure_call implementation
2022-07-15 15:49:04 +01:00
bors
aa0706bf20
Auto merge of #9178 - alex-semenyuk:match_like_matches_macro_fix, r=Jarcho
...
match_like_matches_macro does not trigger when one arm contains conta…
Close #9163
changelog: none
2022-07-15 13:57:46 +00:00