1 // Test that attempt to reborrow an `&mut` pointer in an aliasable
2 // location yields an error.
4 // Example from compiler/rustc_borrowck/borrowck/README.md
6 fn foo(t0: & &mut isize) {
9 **t1 = 22; //~ ERROR cannot assign
12 fn foo3(t0: &mut &mut isize) {
14 let p: &isize = &**t0; //~ ERROR cannot borrow
18 fn foo4(t0: & &mut isize) {
19 let x: &mut isize = &mut **t0; //~ ERROR cannot borrow