summaryrefslogtreecommitdiffstats
path: root/tests/ui/liveness/liveness-use-after-send.rs
blob: 6fcd91a9d9b2e9ff9570b6b2e57722f39bfb4c92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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!(); }