]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs
Update tests for changes to cannot move errors
[rust.git] / src / test / ui / rfc-0107-bind-by-move-pattern-guards / rfc-reject-double-move-across-arms.rs
1 #![feature(nll)]
2 #![feature(bind_by_move_pattern_guards)]
3
4 enum VecWrapper { A(Vec<i32>) }
5
6 fn foo(x: VecWrapper) -> usize {
7     match x {
8         VecWrapper::A(v) if { drop(v); false } => 1,
9         //~^ ERROR cannot move out of `v` in pattern guard
10         VecWrapper::A(v) => v.len()
11     }
12 }
13
14 fn main() {
15     foo(VecWrapper::A(vec![107]));
16 }