rust/src/test/compile-fail/liveness-move-from-args.rs
Gareth Daniel Smith 6d86969260 change the test suite //! kind syntax to //~ kind in order to avoid a
conflict with the new single-line-sugared-inner-doc-comment (`//! ...`).
2012-06-30 12:23:59 +01:00

25 lines
493 B
Rust

fn take(-_x: int) { }
fn from_by_value_arg(++x: int) {
take(x); //~ ERROR illegal move from argument `x`, which is not copy or move mode
}
fn from_by_mut_ref_arg(&x: int) {
take(x); //~ ERROR illegal move from argument `x`, which is not copy or move mode
}
fn from_by_ref_arg(&&x: int) {
take(x); //~ ERROR illegal move from argument `x`, which is not copy or move mode
}
fn from_copy_arg(+x: int) {
take(x);
}
fn from_move_arg(-x: int) {
take(x);
}
fn main() {
}