mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
12 lines
245 B
Rust
12 lines
245 B
Rust
fn expect_fn<F>(f: F) where F : Fn() {
|
|
f();
|
|
}
|
|
|
|
fn main() {
|
|
{
|
|
let x = (vec![22], vec![44]);
|
|
expect_fn(|| drop(x.0));
|
|
//~^ ERROR cannot move out of `x.0`, as `x` is a captured variable in an `Fn` closure [E0507]
|
|
}
|
|
}
|