Fix need-mut large span in closures and a false positive

This commit is contained in:
hkalbasi 2023-04-21 02:13:56 +03:30
parent 0289dfa261
commit 0c621065fb
4 changed files with 69 additions and 29 deletions

View file

@ -105,6 +105,20 @@ fn nested_closures() {
}
}
#[test]
fn capture_specific_fields2() {
size_and_align_expr! {
minicore: copy;
stmts: [
let x = &mut 2;
]
|| {
*x = 5;
&x;
}
}
}
#[test]
fn capture_specific_fields() {
size_and_align_expr! {