]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/regions-escape-bound-fn-2.rs
cb423032b46106736774935175811a175e6455b9
[rust.git] / src / test / ui / borrowck / regions-escape-bound-fn-2.rs
1 fn with_int<F>(f: F) where F: FnOnce(&isize) {
2     let x = 3;
3     f(&x);
4 }
5
6 fn main() {
7     let mut x = None;
8     with_int(|y| x = Some(y));
9     //~^ ERROR borrowed data cannot be stored outside of its closure
10 }