fix need-mut false positive in closure capture of match scrutinee

This commit is contained in:
hkalbasi 2023-05-26 02:08:33 +03:30
parent 7ef185d65e
commit 780349bdaf
4 changed files with 72 additions and 14 deletions

View file

@ -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]