//@ compile-flags: -Zverbose-internals fn to_fn_once(f: F) -> F { f } fn f(y: T) { struct Foo { x: U }; let foo = Foo{ x: "x" }; let c = to_fn_once(move|| { println!("{} {}", foo.x, y); }); c(); c(); //~^ ERROR use of moved value } fn main() { f("S"); }