rust/src/test/compile-fail/borrowck-lend-args.rs
Niko Matsakis 9773a22119 shuffle error messages in borrowck, and prevent it from spewing too many
also, fix a few minor issues it complains about
2012-05-23 12:01:27 -07:00

29 lines
541 B
Rust

// xfail-fast (compile-flags unsupported on windows)
// compile-flags:--borrowck=err
fn borrow(_v: &int) {}
fn borrow_from_arg_imm_ref(&&v: ~int) {
borrow(v);
}
fn borrow_from_arg_mut_ref(&v: ~int) {
borrow(v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to non-pure functions
}
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() {
}