#![allow(warnings)] fn main() { let mut a = 4; let mut b = &mut a; let mut c : &mut &mut u32 = &mut b; let mut d = 44; let mut e = &mut d; let mut f : &mut &mut u32 = &mut e; let mut g : &mut &mut &mut u32 = &mut f; println!("{}",f); let mut h = 444; e = &mut h; g = &mut c; println!("{}",g); } 

(Playground)

Errors:

 Compiling playground v0.0.1 (/playground) error[E0506]: cannot assign to `e` because it is borrowed --> src/main.rs:23:1 | 14 | let mut f : &mut &mut u32 = &mut e; | ------ `e` is borrowed here ... 23 | e = &mut h; | ^^^^^^^^^^ `e` is assigned to here but it was already borrowed ... 26 | g = &mut c; | ------ borrow later used here For more information about this error, try `rustc --explain E0506`. error: could not compile `playground` (bin "playground") due to 1 previous error 

1 post - 1 participant

Read full topic