mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
fix need-mut
false positive in closure capture of match scrutinee
This commit is contained in:
parent
7ef185d65e
commit
780349bdaf
4 changed files with 72 additions and 14 deletions
|
@ -201,7 +201,7 @@ fn match_pattern() {
|
|||
]
|
||||
|x: i64| {
|
||||
match y {
|
||||
X(_a, _b, _c) => x,
|
||||
X(_a, _, _c) => x,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -217,6 +217,18 @@ fn match_pattern() {
|
|||
}
|
||||
}
|
||||
}
|
||||
size_and_align_expr! {
|
||||
minicore: copy;
|
||||
stmts: [
|
||||
struct X(i64, i32, (u8, i128));
|
||||
let y: X = X(2, 5, (7, 3));
|
||||
]
|
||||
|x: i64| {
|
||||
match y {
|
||||
ref _y => x,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue