]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-27282-mutation-in-guard.rs
Rollup merge of #105216 - GuillaumeGomez:rm-unused-gui-test, r=notriddle
[rust.git] / src / test / ui / nll / issue-27282-mutation-in-guard.rs
1 fn main() {
2     match Some(&4) {
3         None => {},
4         ref mut foo
5             if {
6                 (|| { let bar = foo; bar.take() })();
7                 //~^ ERROR cannot move out of `foo` in pattern guard
8                 false
9             } => {},
10         Some(ref _s) => println!("Note this arm is bogus; the `Some` became `None` in the guard."),
11         _ => println!("Here is some supposedly unreachable code."),
12     }
13 }