2023-03-21 02:27:08 -05:00
|
|
|
enum Either {
|
|
|
|
One(X),
|
|
|
|
Two(X),
|
|
|
|
}
|
|
|
|
|
|
|
|
struct X(Y);
|
|
|
|
|
|
|
|
struct Y;
|
|
|
|
|
2024-02-01 16:45:00 -06:00
|
|
|
fn consume_fnmut(f: &mut dyn FnMut()) {
|
2023-03-21 02:27:08 -05:00
|
|
|
f();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn move_into_fnmut() {
|
|
|
|
let x = move_into_fnmut();
|
2024-02-01 16:45:00 -06:00
|
|
|
consume_fnmut(&mut || {
|
2023-03-21 02:27:08 -05:00
|
|
|
let Either::One(_t) = x; //~ ERROR mismatched types
|
|
|
|
let Either::Two(_t) = x; //~ ERROR mismatched types
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|