]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-31287-drop-in-guard.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / issue-31287-drop-in-guard.rs
1 #![feature(if_let_guard)]
2
3 fn main() {
4     let a = Some("...".to_owned());
5     let b = match a {
6         Some(_) if { drop(a); false } => None,
7         x => x, //~ ERROR use of moved value: `a`
8     };
9
10     let a = Some("...".to_owned());
11     let b = match a {
12         Some(_) if let Some(()) = { drop(a); None } => None,
13         x => x, //~ ERROR use of moved value: `a`
14     };
15 }