rust/src/test/compile-fail/liveness-use-after-send.rs
Gareth Daniel Smith 6d86969260 change the test suite //! kind syntax to //~ kind in order to avoid a
conflict with the new single-line-sugared-inner-doc-comment (`//! ...`).
2012-06-30 12:23:59 +01:00

17 lines
435 B
Rust

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) {
send(ch, message); //~ NOTE move of variable occurred here
log(debug, message); //~ ERROR use of moved variable: `message`
}
fn main() { fail; }