1 enum Wrapper {
2     Wrap(i32),
3 }
4 
5 use Wrapper::Wrap;
6 
main()7 pub fn main() {
8     let Wrap(x) = &Wrap(3);
9     *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
10 
11 
12     if let Some(x) = &Some(3) {
13         *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
14     } else {
15         panic!();
16     }
17 
18     while let Some(x) = &Some(3) {
19         *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference
20         break;
21     }
22 }
23