]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/regions-escape-bound-fn-2.rs
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / ui / borrowck / regions-escape-bound-fn-2.rs
1 fn with_int<F>(f: F)
2 where
3     F: FnOnce(&isize),
4 {
5     let x = 3;
6     f(&x);
7 }
8
9 fn main() {
10     let mut x = None;
11     with_int(|y| x = Some(y));
12     //~^ ERROR borrowed data escapes outside of closure
13 }