]> git.lizzy.rs Git - rust.git/blob - src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs
Rollup merge of #102785 - fee1-dead-contrib:rm_autoimpl_defid, r=compiler-errors
[rust.git] / src / test / ui / closures / closure-bounds-static-cant-capture-borrowed.rs
1 fn bar<F>(blk: F) where F: FnOnce() + 'static {
2 }
3
4 fn foo(x: &()) {
5     bar(|| {
6         //~^ ERROR borrowed data escapes
7         //~| ERROR closure may outlive
8         let _ = x;
9     })
10 }
11
12 fn main() {
13 }