]> git.proxmox.com Git - rustc.git/blame - src/test/ui/bind-by-move/bind-by-move-no-guards.rs
New upstream version 1.31.0~beta.4+dfsg1
[rustc.git] / src / test / ui / bind-by-move / bind-by-move-no-guards.rs
CommitLineData
1a4d82fc 1use std::sync::mpsc::channel;
970d7e83 2
223e47cc 3fn main() {
1a4d82fc
JJ
4 let (tx, rx) = channel();
5 let x = Some(rx);
6 tx.send(false);
223e47cc 7 match x {
1a4d82fc
JJ
8 Some(z) if z.recv().unwrap() => { panic!() },
9 //~^ ERROR cannot bind by-move into a pattern guard
10 Some(z) => { assert!(!z.recv().unwrap()); },
11 None => panic!()
223e47cc
LB
12 }
13}