rust/tests/ui/closures/closure-bounds-static-cant-capture-borrowed.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
204 B
Rust
Raw Normal View History

2015-01-03 09:45:00 -06:00
fn bar<F>(blk: F) where F: FnOnce() + 'static {
}
fn foo(x: &()) {
bar(|| {
2022-04-01 12:13:25 -05:00
//~^ ERROR borrowed data escapes
//~| ERROR closure may outlive
let _ = x;
})
}
fn main() {
}