blob: bc99ac788e0e9faab178a51181738b43052b5b23 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
// xfail-pretty
// Protocols
proto! foo (
foo:recv {
do_foo -> foo
}
)
proto! bar (
bar:recv {
do_bar(int) -> barbar,
do_baz(bool) -> bazbar,
}
barbar:send {
rebarbar -> bar,
}
bazbar:send {
rebazbar -> bar
}
)
fn macros() {
include!("select-macro.rs");
}
// Code
fn test(+foo: foo::client::foo, +bar: bar::client::bar) {
use bar::do_baz;
select! (
foo => {
foo::do_foo -> _next {
}
}
bar => {
bar::do_bar(x) -> _next {
debug!("%?", x)
},
do_baz(b) -> _next {
if b { debug!("true") } else { debug!("false") }
}
}
)
}
fn main() {
}
|