RIMOV, round 5

find ./ -type f -name "*.rs" -exec sed -i "s/\&\[mut /\&mut \[/g" {} \;
This commit is contained in:
Ben Striegel 2013-01-29 21:30:22 -05:00
parent 12e8151fb0
commit f08af9a7a5
22 changed files with 64 additions and 60 deletions

View file

@ -16,7 +16,7 @@ fn eval_A(i: uint, j: uint) -> float {
1.0/(((i+j)*(i+j+1u)/2u+i+1u) as float)
}
fn eval_A_times_u(u: &[const float], Au: &[mut float]) {
fn eval_A_times_u(u: &[const float], Au: &mut [float]) {
let N = vec::len(u);
let mut i = 0u;
while i < N {
@ -30,7 +30,7 @@ fn eval_A_times_u(u: &[const float], Au: &[mut float]) {
}
}
fn eval_At_times_u(u: &[const float], Au: &[mut float]) {
fn eval_At_times_u(u: &[const float], Au: &mut [float]) {
let N = vec::len(u);
let mut i = 0u;
while i < N {
@ -44,7 +44,7 @@ fn eval_At_times_u(u: &[const float], Au: &[mut float]) {
}
}
fn eval_AtA_times_u(u: &[const float], AtAu: &[mut float]) {
fn eval_AtA_times_u(u: &[const float], AtAu: &mut [float]) {
let v = vec::cast_to_mut(vec::from_elem(vec::len(u), 0.0));
eval_A_times_u(u, v);
eval_At_times_u(v, AtAu);

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn write(v: &[mut int]) {
fn write(v: &mut [int]) {
v[0] += 1;
}

View file

@ -9,7 +9,7 @@
// except according to those terms.
// xfail-test
fn function() -> &[mut int] {
fn function() -> &mut [int] {
let mut x: &static/[int] = &[1,2,3];
x[0] = 12345;
x //~ ERROR bad

View file

@ -4,7 +4,7 @@ pure fn sum(x: &[int]) -> int {
return sum;
}
fn sum_mut(y: &[mut int]) -> int {
fn sum_mut(y: &mut [int]) -> int {
sum(y)
}

View file

@ -2,7 +2,7 @@ fn foo(v: &[const uint]) -> ~[uint] {
v.to_vec()
}
fn bar(v: &[mut uint]) -> ~[uint] {
fn bar(v: &mut [uint]) -> ~[uint] {
v.to_vec()
}

View file

@ -2,7 +2,7 @@ trait Reverser {
fn reverse(&self);
}
fn bar(v: &[mut uint]) {
fn bar(v: &mut [uint]) {
vec::reverse(v);
vec::reverse(v);
vec::reverse(v);

View file

@ -2,13 +2,13 @@ trait Reverser {
fn reverse(&self);
}
impl &[mut uint] : Reverser {
impl &mut [uint] : Reverser {
fn reverse(&self) {
vec::reverse(*self);
}
}
fn bar(v: &[mut uint]) {
fn bar(v: &mut [uint]) {
v.reverse();
v.reverse();
v.reverse();

View file

@ -4,7 +4,7 @@ pub trait Reader {
/// Read up to len bytes (or EOF) and put them into bytes (which
/// must be at least len bytes long). Return number of bytes read.
// FIXME (#2982): This should probably return an error.
fn read(&self, bytes: &[mut u8], len: uint) -> uint;
fn read(&self, bytes: &mut [u8], len: uint) -> uint;
}
pub trait ReaderUtil {
@ -27,7 +27,7 @@ struct S {
}
impl S: Reader {
fn read(&self, bytes: &[mut u8], len: uint) -> uint {
fn read(&self, bytes: &mut [u8], len: uint) -> uint {
0
}
}

View file

@ -4,7 +4,7 @@ pub trait Reader {
/// Read up to len bytes (or EOF) and put them into bytes (which
/// must be at least len bytes long). Return number of bytes read.
// FIXME (#2982): This should probably return an error.
fn read(&self, bytes: &[mut u8], len: uint) -> uint;
fn read(&self, bytes: &mut [u8], len: uint) -> uint;
}
pub trait ReaderUtil {
@ -27,7 +27,7 @@ struct S {
}
impl S: Reader {
fn read(&self, bytes: &[mut u8], len: uint) -> uint {
fn read(&self, bytes: &mut [u8], len: uint) -> uint {
0
}
}

View file

@ -4,7 +4,7 @@ pub trait Reader {
/// Read up to len bytes (or EOF) and put them into bytes (which
/// must be at least len bytes long). Return number of bytes read.
// FIXME (#2982): This should probably return an error.
fn read(&self, bytes: &[mut u8], len: uint) -> uint;
fn read(&self, bytes: &mut [u8], len: uint) -> uint;
}
pub trait ReaderUtil {
@ -27,7 +27,7 @@ struct S {
}
impl S: Reader {
fn read(&self, bytes: &[mut u8], len: uint) -> uint {
fn read(&self, bytes: &mut [u8], len: uint) -> uint {
0
}
}

View file

@ -4,7 +4,7 @@ pub trait Reader {
/// Read up to len bytes (or EOF) and put them into bytes (which
/// must be at least len bytes long). Return number of bytes read.
// FIXME (#2982): This should probably return an error.
fn read(bytes: &[mut u8], len: uint) -> uint;
fn read(bytes: &mut [u8], len: uint) -> uint;
}
pub trait ReaderUtil {
@ -27,7 +27,7 @@ struct S {
}
impl S: Reader {
fn read(bytes: &[mut u8], len: uint) -> uint {
fn read(bytes: &mut [u8], len: uint) -> uint {
0
}
}

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn swap<T>(v: &[mut T], i: int, j: int) { v[i] <-> v[j]; }
fn swap<T>(v: &mut [T], i: int, j: int) { v[i] <-> v[j]; }
fn main() {
let mut a: ~[int] = ~[0, 1, 2, 3, 4, 5, 6];