]> git.proxmox.com Git - rustc.git/blob - src/test/ui/unboxed-closures/unboxed-closures-borrow-conflict.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / unboxed-closures / unboxed-closures-borrow-conflict.rs
1 // Test that an unboxed closure that mutates a free variable will
2 // cause borrow conflicts.
3
4
5
6 fn main() {
7 let mut x = 0;
8 let f = || x += 1;
9 let _y = x; //~ ERROR cannot use `x` because it was mutably borrowed
10 f;
11 }