]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-in-static.rs
Add 'compiler/rustc_codegen_gcc/' from commit 'afae271d5d3719eeb92c18bc004bb6d1965a5f3f'
[rust.git] / src / test / ui / borrowck / borrowck-in-static.rs
1 // check that borrowck looks inside consts/statics
2
3 static FN : &'static (dyn Fn() -> (Box<dyn Fn()->Box<i32>>) + Sync) = &|| {
4     let x = Box::new(0);
5     Box::new(|| x) //~ ERROR cannot move out of `x`, a captured variable in an `Fn` closure
6 };
7
8 fn main() {
9     let f = (FN)();
10     f();
11     f();
12 }