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

17 lines
403 B
Rust
Raw Normal View History

2012-03-06 00:27:27 +00:00
// error-pattern:unsatisfied precondition constraint
fn send<T: send>(ch: _chan<T>, -data: T) {
log(debug, ch);
log(debug, data);
fail;
}
type _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);
log(debug, message);
}
fn main() { fail; }