Files
rust/tests/ui/nll/issue-52663-span-decl-captured-variable.rs
T
Christian Poveda 7ae2823bc6 Gate 2018 UI tests
2025-11-27 14:13:58 -05:00

13 lines
268 B
Rust

//@ edition:2015..2021
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]
}
}