Auto merge of #10499 - blyxyas:fix-almost_swapped, r=giraffate
Fix `almost_swapped` false positive (`let mut a = b; a = a`) Fixes `2` in #10421 changelog: [`almost_swapped`]: Fix false positive when a variable is changed to itself. (`a = a`)
This commit is contained in:
commit
c465bf7f67
3 changed files with 17 additions and 0 deletions
|
|
@ -186,3 +186,11 @@ const fn issue_9864(mut u: u32) -> u32 {
|
|||
v = temp;
|
||||
u + v
|
||||
}
|
||||
|
||||
#[allow(clippy::let_and_return)]
|
||||
const fn issue_10421(x: u32) -> u32 {
|
||||
let a = x;
|
||||
let a = a;
|
||||
let a = a;
|
||||
a
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,3 +215,11 @@ const fn issue_9864(mut u: u32) -> u32 {
|
|||
v = temp;
|
||||
u + v
|
||||
}
|
||||
|
||||
#[allow(clippy::let_and_return)]
|
||||
const fn issue_10421(x: u32) -> u32 {
|
||||
let a = x;
|
||||
let a = a;
|
||||
let a = a;
|
||||
a
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue