2012-05-16 14:43:57 -05:00
|
|
|
// xfail-fast (compile-flags unsupported on windows)
|
2012-04-26 18:02:01 -05:00
|
|
|
// compile-flags:--borrowck=err
|
|
|
|
|
|
|
|
fn borrow(_v: &int) {}
|
|
|
|
|
|
|
|
fn borrow_from_arg_imm_ref(&&v: ~int) {
|
|
|
|
borrow(v); // ERROR unique value in aliasable, mutable location
|
|
|
|
}
|
|
|
|
|
|
|
|
fn borrow_from_arg_mut_ref(&v: ~int) {
|
|
|
|
borrow(v); //! ERROR unique value in aliasable, mutable location
|
|
|
|
}
|
|
|
|
|
|
|
|
fn borrow_from_arg_move(-v: ~int) {
|
|
|
|
borrow(v);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn borrow_from_arg_copy(+v: ~int) {
|
|
|
|
borrow(v);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn borrow_from_arg_val(++v: ~int) {
|
|
|
|
borrow(v);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|