error[E0503]: cannot use `a` because it was mutably borrowed --> $DIR/borrows-slice.rs:7:5 | 6 | let mut sl = DisjointSlice::new(&mut a); | ------ borrow of `a` occurs here 7 | a[0] = 1; | ^^^^ use of borrowed `a` 8 | sl.get(0..1); | -- borrow later used here error[E0506]: cannot assign to `a[_]` because it is borrowed --> $DIR/borrows-slice.rs:7:5 | 6 | let mut sl = DisjointSlice::new(&mut a); | ------ borrow of `a[_]` occurs here 7 | a[0] = 1; | ^^^^^^^^ assignment to borrowed `a[_]` occurs here 8 | sl.get(0..1); | -- borrow later used here Some errors have detailed explanations: E0503, E0506. For more information about an error, try `rustc --explain E0503`.