9 let mut u = U { b: 0 };
10 // Imm borrow, same field
23 let rma = &mut u.a; //~ ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable
28 u.a = 1; //~ ERROR cannot assign to `u.a` because it is borrowed
31 // Imm borrow, other field
44 let rmb = &mut u.b; //~ ERROR cannot borrow `u` (via `u.b`) as mutable because it is also borrowed as immutable (via `u.a`)
49 u.b = 1; //~ ERROR cannot assign to `u.b` because it is borrowed
52 // Mut borrow, same field
55 let ra = &u.a; //~ ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable
60 let a = u.a; //~ ERROR cannot use `u.a` because it was mutably borrowed
65 let rma2 = &mut u.a; //~ ERROR cannot borrow `u.a` as mutable more than once at a time
70 u.a = 1; //~ ERROR cannot assign to `u.a` because it is borrowed
73 // Mut borrow, other field
76 let rb = &u.b; //~ ERROR cannot borrow `u` (via `u.b`) as immutable because it is also borrowed as mutable (via `u.a`)
81 let b = u.b; //~ ERROR cannot use `u.b` because it was mutably borrowed
87 let rmb2 = &mut u.b; //~ ERROR cannot borrow `u` (via `u.b`) as mutable more than once at a time
92 u.b = 1; //~ ERROR cannot assign to `u.b` because it is borrowed