summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/issue-31287-drop-in-guard.rs
blob: 5b824adc6e2737647f4f739fb87ac8e8088baa93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![feature(if_let_guard)]

fn main() {
    let a = Some("...".to_owned());
    let b = match a {
        Some(_) if { drop(a); false } => None,
        x => x, //~ ERROR use of moved value: `a`
    };

    let a = Some("...".to_owned());
    let b = match a {
        Some(_) if let Some(()) = { drop(a); None } => None,
        x => x, //~ ERROR use of moved value: `a`
    };
}