rust/src/test/compile-fail/liveness-use-after-send.rs

17 lines
440 B
Rust
Raw Normal View History

fn send<T: Send>(ch: _chan<T>, -data: T) {
log(debug, ch);
log(debug, data);
fail;
}
enum _chan<T> = int;
// Tests that "log(debug, message);" is flagged as using
// message after the send deinitializes it
fn test00_start(ch: _chan<int>, message: int, _count: int) {
2012-09-19 00:44:46 -05:00
send(ch, move message); //~ NOTE move of variable occurred here
log(debug, message); //~ ERROR use of moved variable: `message`
}
fn main() { fail; }