blob: a45f7b18e07d689e6c7929824c811c15f10c196d [file] [log] [blame]
// check that borrowck looks inside consts/statics
static FN : &'static (dyn Fn() -> (Box<dyn Fn()->Box<i32>>) + Sync) = &|| {
let x = Box::new(0);
Box::new(|| x) //~ ERROR cannot move out of `x`, a captured variable in an `Fn` closure
};
fn main() {
let f = (FN)();
f();
f();
}