2012-04-26 16:02:01 -07:00
|
|
|
fn borrow(_v: &int) {}
|
|
|
|
|
|
|
|
fn borrow_from_arg_imm_ref(&&v: ~int) {
|
2012-05-22 21:36:50 -07:00
|
|
|
borrow(v);
|
2012-04-26 16:02:01 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
fn borrow_from_arg_mut_ref(&v: ~int) {
|
2012-07-24 16:23:23 -07:00
|
|
|
borrow(v); //~ ERROR illegal borrow unless pure: creating immutable alias to aliasable, mutable memory
|
2012-06-30 12:23:59 +01:00
|
|
|
//~^ NOTE impure due to access to impure function
|
2012-04-26 16:02:01 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
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() {
|
|
|
|
}
|