mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
20 lines
515 B
Rust
20 lines
515 B
Rust
use std::marker;
|
|
|
|
fn send<T:Send + std::fmt::Debug>(ch: Chan<T>, data: T) {
|
|
println!("{:?}", ch);
|
|
println!("{:?}", data);
|
|
panic!();
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
struct Chan<T>(isize, marker::PhantomData<T>);
|
|
|
|
// Tests that "log(debug, message);" is flagged as using
|
|
// message after the send deinitializes it
|
|
fn test00_start(ch: Chan<Box<isize>>, message: Box<isize>, _count: Box<isize>) {
|
|
send(ch, message);
|
|
println!("{}", message); //~ ERROR borrow of moved value: `message`
|
|
}
|
|
|
|
fn main() { panic!(); }
|