2015-02-12 10:29:52 -05:00
|
|
|
use std::marker;
|
|
|
|
|
2018-12-16 22:21:47 -05:00
|
|
|
fn send<T:Send + std::fmt::Debug>(ch: Chan<T>, data: T) {
|
2014-12-20 00:09:35 -08:00
|
|
|
println!("{:?}", ch);
|
|
|
|
println!("{:?}", data);
|
2014-10-09 15:17:22 -04:00
|
|
|
panic!();
|
2011-12-22 14:42:52 -08:00
|
|
|
}
|
2012-04-30 10:37:58 -07:00
|
|
|
|
2015-01-20 15:45:07 -08:00
|
|
|
#[derive(Debug)]
|
2018-12-16 22:21:47 -05:00
|
|
|
struct Chan<T>(isize, marker::PhantomData<T>);
|
2011-08-17 16:58:00 -07:00
|
|
|
|
2011-12-22 17:53:53 -08:00
|
|
|
// Tests that "log(debug, message);" is flagged as using
|
2011-08-17 16:58:00 -07:00
|
|
|
// message after the send deinitializes it
|
2018-12-16 22:21:47 -05:00
|
|
|
fn test00_start(ch: Chan<Box<isize>>, message: Box<isize>, _count: Box<isize>) {
|
2013-01-10 10:59:58 -08:00
|
|
|
send(ch, message);
|
2019-04-22 08:40:08 +01:00
|
|
|
println!("{}", message); //~ ERROR borrow of moved value: `message`
|
2011-08-17 16:58:00 -07:00
|
|
|
}
|
|
|
|
|
2014-10-09 15:17:22 -04:00
|
|
|
fn main() { panic!(); }
|