1 // Test that we can't mutate a place if we need to deref an imm-borrow
4 #![feature(capture_disjoint_fields)]
5 //~^ WARNING: the feature `capture_disjoint_fields` is incomplete
8 let mut x = String::new();
11 let ref_mref_x = &mref_x;
14 //~^ ERROR: cannot borrow `**ref_mref_x` as mutable, as it is behind a `&` reference
22 let x = String::new();
23 let y = String::new();
25 let mref_ref_x = &mut ref_x;
28 //~^ ERROR: cannot borrow `**mref_ref_x` as mutable, as it is behind a `&` reference