bors
510cfe3dc4
Auto merge of #13067 - Jarcho:misc_small3, r=Manishearth
...
Misc refactorings part 3
And some more changes. Same general idea of checking the HIR tree first when linting.
changelog: none
2024-07-08 17:52:47 +00:00
bors
dfb92532fa
Auto merge of #12870 - lrh2000:sig-drop-while, r=blyxyas
...
`significant_drop_in_scrutinee`: Trigger lint also for scrutinees in `while let` and `if let`
This lint should also work for `if let` and `while let`, so this PR makes it actually work.
For `while let`, I can't think of any reason why this lint shouldn't be enabled. The only problem is that the lint suggests moving the significant drop above the `while let`, which is clearly invalid in the case of `while let`. I don't know if this is fixable, but this PR simply disables the wrong suggestions.
For `if let`, it seems that another lint called `if_let_mutex` has some overlapping functionality. But `significant_drop_in_scrutinee` is a bit stricter, as it will trigger even if the `else` branch does not try to lock the same mutex.
changelog: [`significant_drop_in_scrutinee`]: Trigger lint also for scrutinees in `while let` and `if let`.
r? `@blyxyas` (the third PR as promised in https://github.com/rust-lang/rust-clippy/pull/12740#issuecomment-2094876350 , thanks for your review!)
2024-07-08 15:09:45 +00:00
bors
2ad8cdc81b
Auto merge of #13045 - J-ZhengLi:missing_const_for_fn_FP, r=blyxyas
...
[`missing_const_for_fn`]: fix FP when arg ty is impl trait alias ty
closes : #13009
---
changelog: [`missing_const_for_fn`]: fix FP when arg ty is impl trait alias ty
2024-07-08 14:39:12 +00:00
J-ZhengLi
08992d0372
[missing_const_for_fn
]: fix FP when arg ty is impl trait alias ty
2024-07-08 18:09:49 +08:00
Jason Newcomb
0c72a99cac
raw_strings
Check HIR tree first.
2024-07-07 22:19:06 -04:00
Jason Newcomb
e12ff630fd
permissions_set_readonly_false
: Check HIR tree first.
2024-07-07 22:17:43 -04:00
Jason Newcomb
15eac5abd6
Simplify option_env_unwrap
.
2024-07-07 22:17:31 -04:00
Jason Newcomb
ff28de20b4
neg_cmp_op_on_partial_ord
: Delay macro check
2024-07-07 22:14:43 -04:00
Jason Newcomb
7c17dd331b
needless_for_each
: Check HIR tree first.
2024-07-07 22:14:24 -04:00
Jason Newcomb
139dad8849
mut_mut
: Delay macro check
2024-07-07 22:13:05 -04:00
Jason Newcomb
c22608823f
needless_borrowed_ref
: Check HIR tree first.
2024-07-07 22:13:05 -04:00
Jason Newcomb
58aa804ada
mismatching_type_param_order
: Delay macro check.
2024-07-07 22:06:15 -04:00
Jason Newcomb
36a14e3a12
misc
:
...
* Delay macro checks.
* Use `span_lint_hir`.
2024-07-07 22:05:26 -04:00
Jason Newcomb
5b7ffa1a63
Rework init_numbered_fields
:
...
* Only check the name of a single field
* Don't lint in macros
* Check for side effects
* Don't use a binary heap
2024-07-07 20:15:19 -04:00
Jason Newcomb
eda45aaba1
minmax
: use let chain
2024-07-07 18:12:39 -04:00
Jason Newcomb
488a545a50
map_unit_fn
: Delay macro check
2024-07-07 18:12:05 -04:00
Jason Newcomb
7a942a5c99
manual_unwrap_or_default
: Check HIR tree first.
2024-07-07 18:11:55 -04:00
Jason Newcomb
5d333e862b
manual_strip
: Delay msrv check.
2024-07-07 18:11:43 -04:00
Jason Newcomb
c0068ba5ac
manual_slice_size_calculation
: Delay constant check.
2024-07-07 18:11:05 -04:00
Jason Newcomb
03117026ae
manual_retain
: Remove redundant match.
2024-07-07 18:10:46 -04:00
Jason Newcomb
0f4cd13f66
manual_rem_euclid
: Check HIR tree first.
2024-07-07 18:08:44 -04:00
Jason Newcomb
44f87e8cc1
manual_range_patterns
: Delay macro check.
2024-07-07 18:08:11 -04:00
Jason Newcomb
2309f8e4a1
manual_non_exhaustive
: Delay msrv check.
2024-07-07 18:08:02 -04:00
Jason Newcomb
f46c981f3f
manual_main_separator_str
: Check HIR tree first.
2024-07-07 18:07:52 -04:00
Jason Newcomb
2d9e67ea8a
manual_let_else
: Delay msrv and macro checks.
2024-07-07 18:07:36 -04:00
Jason Newcomb
95348adcb9
manual_float_methods
:
...
* Check HIR tree first.
* Use `partition_in_place`.
2024-07-07 18:07:16 -04:00
Jason Newcomb
b9ba340db6
manual_bits
: Delay msrv check
2024-07-07 18:06:36 -04:00
Jason Newcomb
c0fa6a92f0
literal_representation
: Delay macro check.
2024-07-07 18:06:27 -04:00
Jason Newcomb
15f640a7cb
let_with_type_underscore
:
...
* Delay macro check.
* Use `is_from_proc_macro
2024-07-07 18:06:17 -04:00
Jason Newcomb
5332def0fd
let_underscore
: Delay macro check.
2024-07-07 18:06:00 -04:00
Jason Newcomb
fed75b3895
let_if_seq
: use array_windows
.
2024-07-07 18:05:51 -04:00
Jason Newcomb
ff4e62d3ec
len_zero
: Check HIR tree first
2024-07-07 18:05:41 -04:00
Jason Newcomb
5ae33c7699
legacy_numeric_constants
: Check HIR tree first.
2024-07-07 16:52:59 -04:00
Jason Newcomb
03036c11b3
large_include_file
: Check HIR tree first.
2024-07-07 16:52:33 -04:00
Jason Newcomb
c3dd028d3e
large_futures
: Delay macro check
2024-07-07 16:52:13 -04:00
Jason Newcomb
430c02cbd0
large_enum_variant
: Delay macro check
2024-07-07 16:51:58 -04:00
Jason Newcomb
3092c8a5fd
large_const_arrays
: Check HIR tree first.
2024-07-07 16:51:33 -04:00
Jason Newcomb
6b10b4360c
iter_without_into_iter
: Delay macro check
2024-07-07 16:51:20 -04:00
Jason Newcomb
fa1a690b23
iter_not_returning_iterator
:
...
* Check HIR tree first.
* Check name by symbol.
2024-07-07 16:43:07 -04:00
Jason Newcomb
ca5c2813eb
items_after_statements
: Do less work in the default case.
2024-07-07 16:41:36 -04:00
Jason Newcomb
aef0710054
instant_subtraction
: Reduce redundant work.
2024-07-07 16:37:51 -04:00
Jason Newcomb
dc8403f0f5
inline_fn_without_body
: inline into a single function
2024-07-07 16:37:31 -04:00
Jason Newcomb
8e2ddc800b
inherent_to_string
: Check HIR tree before checking for macros.
2024-07-07 16:35:05 -04:00
Jason Newcomb
f493d71a38
infinite_iter
: Only lock the symbol table once.
2024-07-07 16:27:27 -04:00
Jason Newcomb
c73aceb043
indexing_slicing
: Check HIR tree first.
2024-07-07 16:26:57 -04:00
Jason Newcomb
06f83b4e26
index_refutable_slice
: Check HIR tree first.
2024-07-07 16:26:42 -04:00
Jason Newcomb
b58b491d16
inconsistent_struct_constructor
: Check HIR tree first.
2024-07-07 16:26:04 -04:00
Jason Newcomb
3869e93408
ignored_unit_patterns
: Reorder checks.
2024-07-07 16:24:45 -04:00
Jason Newcomb
517e1ac225
if_then_some_else_none
: Check HIR tree before other checks.
2024-07-07 16:23:50 -04:00
Jason Newcomb
b26b820f3f
Refactor if_not_else
:
...
* Check HIR tree first.
* Merge lint calls.
2024-07-07 16:23:18 -04:00