]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/closure-bounds-static-cant-capture-borrowed.rs
Rollup merge of #107272 - compiler-errors:new-solver-more-predicates, r=lcnr
[rust.git] / tests / 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 }