]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs
Auto merge of #63233 - RalfJung:get_unchecked, r=Centril
[rust.git] / src / test / ui / rfc-0107-bind-by-move-pattern-guards / bind-by-move-no-guards.rs
1 // Adaptation of existing ui test (from way back in
2 // rust-lang/rust#2329), that starts passing with this feature in
3 // place.
4
5 // run-pass
6
7 #![feature(bind_by_move_pattern_guards)]
8
9 use std::sync::mpsc::channel;
10
11 fn main() {
12     let (tx, rx) = channel();
13     let x = Some(rx);
14     tx.send(false);
15     tx.send(false);
16     match x {
17         Some(z) if z.recv().unwrap() => { panic!() },
18         Some(z) => { assert!(!z.recv().unwrap()); },
19         None => panic!()
20     }
21 }