2012-12-10 19:32:48 -06:00
|
|
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2012-09-19 00:45:24 -05:00
|
|
|
// tjc: un-xfail after snapshot
|
|
|
|
// xfail-test
|
2012-08-13 20:34:44 -05:00
|
|
|
// xfail-pretty
|
2012-08-07 12:14:35 -05:00
|
|
|
|
|
|
|
// Protocols
|
2012-08-22 20:10:48 -05:00
|
|
|
proto! foo (
|
2012-08-07 12:14:35 -05:00
|
|
|
foo:recv {
|
|
|
|
do_foo -> foo
|
|
|
|
}
|
2012-08-22 20:10:48 -05:00
|
|
|
)
|
2012-08-07 12:14:35 -05:00
|
|
|
|
2012-08-22 20:10:48 -05:00
|
|
|
proto! bar (
|
2012-08-07 12:14:35 -05:00
|
|
|
bar:recv {
|
|
|
|
do_bar(int) -> barbar,
|
|
|
|
do_baz(bool) -> bazbar,
|
|
|
|
}
|
|
|
|
|
|
|
|
barbar:send {
|
|
|
|
rebarbar -> bar,
|
|
|
|
}
|
|
|
|
|
|
|
|
bazbar:send {
|
|
|
|
rebazbar -> bar
|
|
|
|
}
|
2012-08-22 20:10:48 -05:00
|
|
|
)
|
2012-08-07 12:14:35 -05:00
|
|
|
|
2012-08-17 13:47:01 -05:00
|
|
|
fn macros() {
|
|
|
|
include!("select-macro.rs");
|
2012-08-07 12:14:35 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Code
|
|
|
|
fn test(+foo: foo::client::foo, +bar: bar::client::bar) {
|
2012-09-07 20:08:21 -05:00
|
|
|
use bar::do_baz;
|
2012-08-13 18:03:13 -05:00
|
|
|
|
2012-08-22 19:24:52 -05:00
|
|
|
select! (
|
2012-08-07 12:14:35 -05:00
|
|
|
foo => {
|
|
|
|
foo::do_foo -> _next {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bar => {
|
|
|
|
bar::do_bar(x) -> _next {
|
2012-08-13 18:03:13 -05:00
|
|
|
debug!("%?", x)
|
2012-08-07 12:14:35 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
do_baz(b) -> _next {
|
2012-10-11 19:59:14 -05:00
|
|
|
if b { debug!("true") } else { debug!("false") }
|
2012-08-07 12:14:35 -05:00
|
|
|
}
|
|
|
|
}
|
2012-08-22 19:24:52 -05:00
|
|
|
)
|
2012-08-07 12:14:35 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|