2013-01-22 17:20:08 -08:00
|
|
|
pure fn negate(x: &int) -> int {
|
|
|
|
-*x
|
|
|
|
}
|
|
|
|
|
|
|
|
fn negate_mut(y: &mut int) -> int {
|
|
|
|
negate(y)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn negate_imm(y: &int) -> int {
|
|
|
|
negate(y)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn negate_const(y: &const int) -> int {
|
|
|
|
negate(y)
|
|
|
|
}
|
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {}
|