]> git.lizzy.rs Git - rust.git/blob - tests/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs
Rollup merge of #106638 - RalfJung:realstd, r=thomcc
[rust.git] / tests / 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 use std::sync::mpsc::channel;
8
9 fn main() {
10     let (tx, rx) = channel();
11     let x = Some(rx);
12     tx.send(false).unwrap();
13     tx.send(false).unwrap();
14     match x {
15         Some(z) if z.recv().unwrap() => { panic!() },
16         Some(z) => { assert!(!z.recv().unwrap()); },
17         None => panic!()
18     }
19 }