rust/src/test/compile-fail/liveness-move-from-args.rs
Tim Chevalier e16dbb7888 Demode some code using by-mutbl-ref; warn about by-mutbl-ref
The parser now warns about use of mutbl-ref mode, though it's kind
of a lie since this commit doesn't remove support for the mode.

Changed move_val_init to have stage0 and stage1/2 versions, the latter of
which is demoded.

Changed the type that the typechecker expects the move_val_init
intrinsic to have. After this is pushed, I can make a new snapshot,
which will remove the need for the stage0 versions.
2012-10-05 15:37:01 -07:00

21 lines
369 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_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() {
}