]> git.proxmox.com Git - rustc.git/blob - src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-1.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / closures / 2229_closure_analysis / diagnostics / borrowck / borrowck-1.rs
1 // edition:2021
2
3 #[derive(Debug)]
4 struct Point {
5 x: i32,
6 y: i32,
7 }
8 fn main() {
9 let mut p = Point {x: 1, y: 2 };
10
11 let y = &mut p.y;
12 let mut c = || {
13 //~^ ERROR cannot borrow `p` as mutable more than once at a time
14 let x = &mut p.x;
15 println!("{:?}", p);
16 };
17 c();
18 *y+=1;
19 }