]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/suggest-split-at-mut.rs
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / suggest-split-at-mut.rs
1 fn main() {
2     let mut foo = [1, 2, 3, 4];
3     let a = &mut foo[2];
4     let b = &mut foo[3]; //~ ERROR cannot borrow `foo[_]` as mutable more than once at a time
5     *a = 5;
6     *b = 6;
7     println!("{:?} {:?}", a, b);
8 }