summaryrefslogtreecommitdiffstats
path: root/src/test/ui/borrowck/issue-31287-drop-in-guard.rs
blob: 07125b98a1f7d10ad744d63da681b0cdd2738a9a (plain)
1
2
3
4
5
6
7
8
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`
    };
    println!("{:?}", b);
}