error[E0502]: cannot borrow `slice_1` as mutable because it is also borrowed as immutable --> compile_fail_tests/mut_lock_4.rs | | let element = slice_1.get(1).unwrap(); | -------------- immutable borrow occurs here | | let _ = slice_1.iter_mut(); | ^^^^^^^^^^^^^^^^^^ mutable borrow occurs here | | let _ = element.borrow(); | ---------------- immutable borrow later used here