2019-07-27 00:54:25 +03:00
|
|
|
// run-pass
|
|
|
|
|
2018-09-14 12:20:28 +02:00
|
|
|
#![allow(unused_must_use)]
|
2011-05-18 11:38:41 -07:00
|
|
|
/*
|
|
|
|
This is about the simplest program that can successfully send a
|
|
|
|
message.
|
|
|
|
*/
|
2013-05-24 19:35:29 -07:00
|
|
|
|
2014-12-23 11:53:35 -08:00
|
|
|
use std::sync::mpsc::channel;
|
2014-12-22 09:04:23 -08:00
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2014-03-09 14:58:32 -07:00
|
|
|
let (tx, rx) = channel();
|
2015-01-25 22:05:03 +01:00
|
|
|
tx.send(42);
|
2014-03-09 14:58:32 -07:00
|
|
|
let r = rx.recv();
|
2014-12-20 00:09:35 -08:00
|
|
|
println!("{:?}", r);
|
2011-08-10 09:27:22 -07:00
|
|
|
}
|