2013-03-16 13:11:31 -05:00
|
|
|
// xfail-test
|
|
|
|
|
2013-01-22 19:20:08 -06:00
|
|
|
pure fn sum(x: &[int]) -> int {
|
|
|
|
let mut sum = 0;
|
|
|
|
for x.each |y| { sum += *y; }
|
|
|
|
return sum;
|
|
|
|
}
|
|
|
|
|
2013-01-29 20:30:22 -06:00
|
|
|
fn sum_mut(y: &mut [int]) -> int {
|
2013-01-22 19:20:08 -06:00
|
|
|
sum(y)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn sum_imm(y: &[int]) -> int {
|
|
|
|
sum(y)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn sum_const(y: &[const int]) -> int {
|
|
|
|
sum(y)
|
|
|
|
}
|
|
|
|
|
2013-02-04 13:07:36 -06:00
|
|
|
pub fn main() {}
|