This commit is contained in:
Matthias Krüger 2024-04-27 14:26:43 +02:00
parent c968b8b777
commit c32e2fe179

22
tests/crashes/109812.rs Normal file
View File

@ -0,0 +1,22 @@
//@ known-bug: #109812
#![warn(rust_2021_incompatible_closure_captures)]
enum Either {
One(X),
Two(X),
}
struct X(Y);
struct Y;
fn move_into_fnmut() {
let x = X(Y);
consume_fnmut(|| {
let Either::Two(ref mut _t) = x;
let X(mut _t) = x;
});
}