summaryrefslogtreecommitdiffstats
path: root/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs
blob: d1f685f3e7a6da77d23bba0ba9d913d387fd6f70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
enum VecWrapper { A(Vec<i32>) }

fn foo(x: VecWrapper) -> usize {
    match x {
        VecWrapper::A(v) if { drop(v); false } => 1,
        //~^ ERROR cannot move out of `v` in pattern guard
        VecWrapper::A(v) => v.len()
    }
}

fn main() {
    foo(VecWrapper::A(vec![107]));
}