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

13 lines
355 B
Rust
Raw Normal View History

// error-pattern: Unsatisfied precondition constraint
2011-09-12 12:39:38 +02:00
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; }