bors
d3d235dcbf
Auto merge of #10345 - J-ZhengLi:issue_10049, r=xFrednet
...
fix [`needless_return`] incorrect suggestion when returning if sequence
fixes : #10049
---
changelog: [`needless_return`]: fix incorrect suggestion on if sequence
2023-02-15 10:27:46 +00:00
bors
e018a2c8bd
Auto merge of #10328 - compiler-errors:fix-re-erased-in-needless_pass_by_value, r=matthiaskrgr
...
Liberate late-bound regions rather than erasing them in `needless_pass_by_value`
changelog: [`needless_pass_by_value`]: fixes an ICE when there are late-bound regions in function arguments that are needlessly passed by value
Fixes rust-lang/rust#107147
r? `@matthiaskrgr`
2023-02-15 06:41:35 +00:00
J-ZhengLi
8b93eb8a9b
add some adjustment regarding review suggestion
2023-02-15 11:26:30 +08:00
Samuel Tardieu
7f15a11aa1
manual_let_else: let/else is not divergent by default
...
The divergent `else` block of a `let`/`else` statement does not make
the `let`/`else` statement itself divergent.
2023-02-15 00:47:43 +01:00
Michael Goulet
17cb2e47e5
Liberate late-bound regions rather than erasing them in needless_pass_by_value
2023-02-14 23:27:46 +00:00
bors
0e40f94a86
Auto merge of #10346 - samueltardieu:issue-10331, r=Manishearth
...
Do not base map_entry lint suggestion on expanded code
Fixes #10331
changelog: [`map_entry`]: do not base suggestion on code expanded by the compiler
2023-02-14 23:21:08 +00:00
Samuel Tardieu
e4e5924b99
Do not base map_entry lint suggestion on expanded code
2023-02-14 15:37:48 +01:00
Samuel Tardieu
657ee48bec
Ignore instructions following a break from block in never_loop lint
...
It is not sufficient to ignore break from a block inside the loop.
Instructions after the break must be ignored, as they are unreachable.
This is also true for all instructions in outer blocks and loops
until the right block is reached.
2023-02-14 09:55:44 +01:00
Samuel Tardieu
e9dffa3910
Fix a bug in never_loop when anonymous blocks are nested in named blocks
...
The following code
```
loop {
'a: {
{ }
break 'a;
}
}
```
was detected as a never-looping loop.
2023-02-14 09:23:04 +01:00
J-ZhengLi
8e96adedd5
fix [needless_return
] incorrect suggestion when returning if sequence
2023-02-14 11:31:42 +08:00
bors
ac60dcaa25
Auto merge of #10177 - chansuke:almost_swapped, r=Alexendoo
...
Almost swapped
Take over from https://github.com/rust-lang/rust-clippy/pull/8945
Fix https://github.com/rust-lang/rust-clippy/issues/8151
---
changelog: enhancement: [`almost_swapped`]: Now detects almost swaps using `let` statements
[#10177 ](https://github.com/rust-lang/rust-clippy/pull/10177 )
<!-- changelog_checked -->
2023-02-13 13:20:18 +00:00
chansuke
ebca1b5d00
Refactor almost_swapped
to lint with let
statement correctly
2023-02-13 16:16:31 +09:00
bors
298f139798
Auto merge of #10317 - m-ou-se:suspicious-command-arg-space, r=Manishearth
...
Add `suspicious_command_arg_space` lint
Fixes #10316
---
changelog: New lint: [`suspicious_command_arg_space`]
[#10317 ](https://github.com/rust-lang/rust-clippy/pull/10317 )
<!-- changelog_checked -->
2023-02-12 21:57:49 +00:00
bors
6f353fdf0a
Auto merge of #10310 - c410-f3r:arith-2, r=Alexendoo
...
[arithmetic_side_effects] Fix #10209
Fix #10209
---
changelog: Enhancement: [`arithmetic_side_effects`]: No longer lints, if safe constant values are used.
[#10310 ](https://github.com/rust-lang/rust-clippy/pull/10310 )
<!-- changelog_checked -->
2023-02-12 19:34:15 +00:00
Caio
e70a7a68bd
[arithmetic_side_effects] Evaluate integers originated from constant declarations
2023-02-12 16:19:51 -03:00
Samuel Tardieu
d9dc1679f5
cast_possible_truncation: issue proper help message
2023-02-12 08:56:21 +01:00
Mara Bos
805a0ae2df
Add more test cases for suspicious_command_arg_space.
2023-02-10 22:35:23 +01:00
Mara Bos
5fefe8b317
Add test.
2023-02-10 19:02:39 +01:00
Philipp Krones
7c61b4ed89
Merge remote-tracking branch 'upstream/master' into rustup
2023-02-10 11:33:45 +01:00
DevAccentor
179c037643
improve almost swap to look for let statement
2023-02-10 18:00:46 +09:00
bors
fd2d8beaf8
Auto merge of #10293 - Alexendoo:bool-assert-comparison-negation, r=dswij
...
Negate suggestions when needed in `bool_assert_comparison`
changelog: none assuming this gets into the same release as #10218
Fixes #10291
r? `@dswij`
Thanks to `@black-puppydog` for spotting it early
2023-02-08 23:03:32 +00:00
Kartavya Vashishtha
b7c38981ff
bless new output
2023-02-07 15:39:19 +05:30
Kartavya Vashishtha
46edafe8c1
blessed stderr output
2023-02-05 01:18:29 +05:30
Alex Macleod
5546c82051
Negate suggestions when needed in bool_assert_comparison
2023-02-04 19:28:11 +00:00
Michael Krasnitski
fba16e2e3a
Add extra_unused_type_parameters
lint
2023-02-02 19:37:34 -05:00
bors
006a4cc767
Auto merge of #10276 - m-ou-se:manual-assert, r=Alexendoo
...
Don't depend on FormatArgsExpn in ManualAssert.
Part of https://github.com/rust-lang/rust-clippy/issues/10233
changelog: none
2023-02-02 14:47:43 +00:00
Mara Bos
ecd98bad45
Bless tests.
2023-02-01 22:51:02 +01:00
bors
a2f85deba3
Auto merge of #10250 - tylerjw:issue_7419, r=xFrednet
...
wildcard_enum_match_arm lint takes the enum origin into account
fixes #7419
---
changelog: Enhancement: [`wildcard_enum_match_arm`]: Now lints missing private variants, for local enums
[#10250 ](https://github.com/rust-lang/rust-clippy/pull/10250 )
<!-- changelog_checked -->
2023-02-01 20:01:56 +00:00
Alex Macleod
6a8b20230b
Add machine applicable suggestion for needless_lifetimes
...
Also adds a test for #5787
2023-01-31 14:12:03 +00:00
bors
d227f18c2e
Auto merge of #10225 - evantypanski:et/issue10132, r=flip1995
...
[`unused_io_amount`]: Lint with `is_ok` and `is_err`
Fixes #10132
changelog: Apply [`unused_io_amount`] lint to `is_ok` and `is_err` without checking read/write amount
2023-01-31 08:20:21 +00:00
Tyler Weaver
2432e97d6a
wildcard_enum_match_arm lint takes the enum origin into account
...
Signed-off-by: Tyler Weaver <maybe@tylerjw.dev>
2023-01-30 17:29:29 -07:00
Tyler Weaver
4fde96c30e
Test needless_lifetimes within external macro
...
Signed-off-by: Tyler Weaver <maybe@tylerjw.dev>
2023-01-30 16:16:53 -07:00
Tyler Weaver
c959813bfd
needless_lifetimes: macro test
...
Signed-off-by: Tyler Weaver <maybe@tylerjw.dev>
2023-01-30 16:04:31 -07:00
Esteban Küber
821199c885
Modify primary span label for E0308
...
The previous output was unintuitive to users.
2023-01-30 20:12:19 +00:00
bors
d020fd7fe6
Auto merge of #10260 - Niki4tap:external_macro_fp, r=xFrednet
...
`multiple_unsafe_ops_per_block`: Don't lint in external macros
Fixes #10259
changelog: FP: [`multiple_unsafe_ops_per_block`]: No longer lints in external macros
[#10260 ](https://github.com/rust-lang/rust-clippy/pull/10260 )
<!-- changelog_none -->
2023-01-30 20:10:19 +00:00
bors
173fac0989
Auto merge of #10255 - khayyamsaleem:issue_9520, r=Jarcho
...
prevents `len_without_is_empty` from yielding positive when `len` takes arguments besides `&self`
Fixes #9520
---
changelog: FP [`len_without_is_empty`]: No longer lints, if `len` as a non-default signature
[#10255 ](https://github.com/rust-lang/rust-clippy/pull/10255 )
<!-- changelog_checked -->
2023-01-30 19:08:04 +00:00
Niki4tap
926c5e4cde
multiple_unsafe_ops_per_block: don't lint in external macros
2023-01-30 20:42:40 +03:00
Tyler Weaver
5ed191de6b
bless
2023-01-30 10:10:52 -07:00
ksaleem
2fd94a4e01
prevents len_without_is_empty
from yielding positive when len
takes
...
more than just `&self` in non-standard implementations.
changelog: Fix [`len_without_is_empty`] false positive when len has a
non-standard method signature
Fixes #9520
2023-01-29 17:35:36 -05:00
Tyler Weaver
4d266d31de
needless_range_loop: improve documentation
2023-01-29 11:41:53 -07:00
bors
96c28d1f69
Auto merge of #10231 - Alexendoo:regex-spans, r=llogiq
...
`invalid_regex`: Show full error when string value doesn't match source
changelog: [`invalid_regex`]: Show full error when parsing non-literals or regular strings containing escape sequences
Fixes #4170 , the escape sequence there causes the span to be incorrect which will have caused most of the confusion
2023-01-29 14:13:58 +00:00
Philipp Krones
5c7a65251a
Merge commit '1480cea393d0cee195e59949eabdfbcf1230f7f9' into clippyup
2023-01-27 21:09:08 +01:00
Philipp Krones
2bc2431fd1
Merge remote-tracking branch 'upstream/master' into rustup
2023-01-27 20:26:35 +01:00
Alex Macleod
986f40fab0
invalid_regex
: Show full error when string value doesn't match source
2023-01-26 15:33:40 +00:00
Martin Fischer
20cc72e8a8
Improve span for module_name_repetitions
2023-01-25 07:07:10 +01:00
Evan Typanski
f9f75e0932
Lint unused_io_amount
with is_ok
and is_err
2023-01-24 18:22:35 -05:00
bors
a9c251f11d
Auto merge of #10106 - koka831:fix/10084, r=Alexendoo
...
Fix FP in `unnecessary_safety_comment`
Fix https://github.com/rust-lang/rust-clippy/issues/10084
changelog: FP: [`unnecessary_safety_comment`]: No longer lints code inside macros
[#10106 ](https://github.com/rust-lang/rust-clippy/pull/10106 )
<!-- changelog_checked -->
2023-01-22 14:10:16 +00:00
Alex Macleod
5f49808bde
Add machine applicable suggestion for bool_assert_comparison
2023-01-21 17:33:39 +00:00
bors
aa0eb7fb1c
Auto merge of #10206 - Niki4tap:one_unsafe_op_per_block, r=Alexendoo
...
Add `multiple_unsafe_ops_per_block` lint
Adds a lint, which restricts an `unsafe` block to only one unsafe operation.
Closes #10064
---
changelog: New lint: [`multiple_unsafe_ops_per_block`]
[#10206 ](https://github.com/rust-lang/rust-clippy/pull/10206 )
<!-- changelog_checked -->
2023-01-19 13:58:09 +00:00
Niki4tap
875e36f7e4
Add multiple_unsafe_ops_per_block
lint
2023-01-18 10:00:31 +03:00