rust/src/test/compile-fail/borrowck-lend-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

26 lines
451 B
Rust

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 impure function
}
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() {
}