]> git.lizzy.rs Git - rust.git/blob - src/test/ui/let-else/let-else-binding-immutable.rs
Rollup merge of #99479 - Enselic:import-can-be-without-id, r=camelid
[rust.git] / src / test / ui / let-else / let-else-binding-immutable.rs
1 // from rfc2005 test suite
2
3 #![feature(let_else)]
4
5 pub fn main() {
6     let Some(x) = &Some(3) else {
7         panic!();
8     };
9     *x += 1; //~ ERROR: cannot assign to `*x`, which is behind a `&` reference
10 }