2012-12-10 19:32:48 -06:00
|
|
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2012-12-11 15:50:04 -06:00
|
|
|
fn send<T: Owned>(ch: _chan<T>, -data: T) {
|
2011-12-22 19:53:53 -06:00
|
|
|
log(debug, ch);
|
|
|
|
log(debug, data);
|
2011-12-22 16:42:52 -06:00
|
|
|
fail;
|
|
|
|
}
|
2012-04-30 12:37:58 -05:00
|
|
|
|
|
|
|
enum _chan<T> = int;
|
2011-08-17 18:58:00 -05:00
|
|
|
|
2011-12-22 19:53:53 -06:00
|
|
|
// Tests that "log(debug, message);" is flagged as using
|
2011-08-17 18:58:00 -05:00
|
|
|
// message after the send deinitializes it
|
2012-05-23 22:53:49 -05:00
|
|
|
fn test00_start(ch: _chan<int>, message: int, _count: int) {
|
2013-01-18 15:34:47 -06:00
|
|
|
send(ch, move message); //~ NOTE move of value occurred here
|
2013-01-11 14:47:14 -06:00
|
|
|
log(debug, message); //~ ERROR use of moved value: `message`
|
2011-08-17 18:58:00 -05:00
|
|
|
}
|
|
|
|
|
2011-08-19 17:16:48 -05:00
|
|
|
fn main() { fail; }
|