]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/regions-escape-bound-fn-2.rs
Merge commit 'e8dca3e87d164d2806098c462c6ce41301341f68' into sync_from_cg_gcc
[rust.git] / src / test / 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 }