rust/src/test/compile-fail/use-after-send.rs
Brian Anderson 518dc52f85 Reformat
This changes the indexing syntax from .() to [], the vector syntax from ~[] to
[] and the extension syntax from #fmt() to #fmt[]
2011-08-20 11:04:00 -07:00

13 lines
355 B
Rust

// error-pattern: Unsatisfied precondition constraint
fn send<~T>(ch: _chan<T>, data: -T) { log ch; log data; fail; }
type _chan<T> = int;
// Tests that "log message;" is flagged as using
// message after the send deinitializes it
fn test00_start(ch: _chan<int>, message: int, count: int) {
send(ch, message);
log message;
}
fn main() { fail; }