error[E0502]: cannot borrow `slice_1` as mutable because it is also borrowed as immutable --> compile_fail_tests/mut_lock_1.rs | | let slice_2 = slice_1.slice(0..2).unwrap(); | ------------------- immutable borrow occurs here | | let a = slice_1.get_mut(3).unwrap().borrow_mut(); | ^^^^^^^^^^^^^^^^^^ mutable borrow occurs here ... | let _ = (&slice_1, &slice_2); | -------- immutable borrow later used here