2018-08-07 19:50:19 +02:00
|
|
|
fn expect_fn<F>(f: F) where F : Fn() {
|
|
|
|
|
f();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
{
|
|
|
|
|
let x = (vec![22], vec![44]);
|
|
|
|
|
expect_fn(|| drop(x.0));
|
2019-05-05 12:02:32 +01:00
|
|
|
//~^ ERROR cannot move out of `x.0`, as `x` is a captured variable in an `Fn` closure [E0507]
|
2018-08-07 19:50:19 +02:00
|
|
|
}
|
|
|
|
|
}
|