]> git.proxmox.com Git - rustc.git/blame - src/test/ui/borrowck/regions-escape-bound-fn.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / borrowck / regions-escape-bound-fn.rs
CommitLineData
f9f354fc
XL
1fn with_int<F>(f: F)
2where
3 F: FnOnce(&isize),
4{
223e47cc
LB
5 let x = 3;
6 f(&x);
7}
8
9fn main() {
1a4d82fc 10 let mut x: Option<&isize> = None;
2c00a5a8 11 with_int(|y| x = Some(y));
f9f354fc 12 //~^ ERROR borrowed data escapes outside of closure
223e47cc 13}