rust/src/test/compile-fail/use-after-send.rs
Marijn Haverbeke f6491bb426 Update stdlib, compiler, and tests to new kind system
This involved adding 'copy' to more generics than I hoped, but an
experiment with making it implicit showed that that way lies madness --
unless enforced, you will not remember to mark functions that don't
copy as not requiring copyable kind.

Issue #1177
2011-11-18 12:49:01 +01:00

13 lines
359 B
Rust

// error-pattern: Unsatisfied precondition constraint
fn send<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; }