]> git.proxmox.com Git - rustc.git/blob - src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-3.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / closures / 2229_closure_analysis / diagnostics / borrowck / borrowck-3.rs
1 // edition:2021
2
3 #[derive(Debug)]
4 struct Point {
5 x: String,
6 y: String,
7 }
8 fn main() {
9 let mut c = {
10 let mut p = Point {x: "1".to_string(), y: "2".to_string() };
11 || {
12 let x = &mut p.x;
13 println!("{:?}", p);
14 //~^ ERROR `p` does not live long enough
15 }
16 };
17 c();
18 }