1 // from rfc2005 test suite
5 // Verify the binding mode shifts - only when no `&` are auto-dereferenced is the
6 // final default binding mode mutable.
9 let Some(n) = &&Some(5i32) else { return };
10 *n += 1; //~ ERROR cannot assign to `*n`, which is behind a `&` reference
13 let Some(n) = &mut &Some(5i32) else { return };
14 *n += 1; //~ ERROR cannot assign to `*n`, which is behind a `&` reference
17 let Some(n) = &&mut Some(5i32) else { return };
18 *n += 1; //~ ERROR cannot assign to `*n`, which is behind a `&` reference