2024-09-15 14:18:41 -05:00
|
|
|
//@ compile-flags: -Zvalidate-mir --edition=2018 --crate-type=lib -Copt-level=3
|
|
|
|
|
|
|
|
#![feature(async_closure)]
|
|
|
|
|
|
|
|
fn main() {}
|
|
|
|
|
|
|
|
fn needs_fn_mut<T>(mut x: impl FnMut() -> T) {
|
|
|
|
x();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn hello(x: Ty) {
|
|
|
|
needs_fn_mut(async || {
|
2024-09-15 15:07:08 -05:00
|
|
|
//~^ ERROR cannot move out of `x`
|
2024-09-15 14:18:41 -05:00
|
|
|
x.hello();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Ty;
|
|
|
|
impl Ty {
|
|
|
|
fn hello(self) {}
|
|
|
|
}
|