]>
git.proxmox.com Git - rustc.git/blob - src/test/run-pass/select-macro.rs
1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // xfail-test - this isn't really a test.
16 macro_rules
! select_if (
29 $
(type_this $message
:path$
(($
(x $x
: ident
),+))dont_type_this
*
30 -> $next
:ident
=> { $e:expr }
),+
33 $
(type_this $messages
:path$
(($
(x $xs
: ident
),+))dont_type_this
*
34 -> $nexts
:ident
=> { $es:expr }
),+
38 match pipes
::try_recv($port
) {
39 $
(Some($
message($
($
($x
,)+)* next
)) => {
50 $
(type_this $messages$
(($
(x $xs
),+))dont_type_this
*
51 -> $nexts
=> { $es }
),+
61 $
($message
:path$
(($
($x
: ident
),+))dont_type_this
*
62 -> $next
:ident $e
:expr
),+
65 let index
= pipes
::selecti([$
(($port
).header()),+]);
66 select_if
!(index
, 0 $
(, $port
=> [
67 $
(type_this $message$
(($
(x $x
),+))dont_type_this
* -> $next
=> { $e }
),+