]> git.lizzy.rs Git - rust.git/blob - tests/ui/liveness/liveness-use-after-send.rs
Don't resolve type var roots in point_at_expr_source_of_inferred_type
[rust.git] / tests / ui / liveness / liveness-use-after-send.rs
1 use std::marker;
2
3 fn send<T:Send + std::fmt::Debug>(ch: Chan<T>, data: T) {
4     println!("{:?}", ch);
5     println!("{:?}", data);
6     panic!();
7 }
8
9 #[derive(Debug)]
10 struct Chan<T>(isize, marker::PhantomData<T>);
11
12 // Tests that "log(debug, message);" is flagged as using
13 // message after the send deinitializes it
14 fn test00_start(ch: Chan<Box<isize>>, message: Box<isize>, _count: Box<isize>) {
15     send(ch, message);
16     println!("{}", message); //~ ERROR borrow of moved value: `message`
17 }
18
19 fn main() { panic!(); }