99674dc52b
expressions. cc #2981
26 lines
461 B
Rust
26 lines
461 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: creating immutable alias to aliasable, mutable memory
|
|
//~^ 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() {
|
|
}
|