RIMOV, round 4
find ./ -type f -name "*.rs" -exec sed -i "s/let mut \(.*\)\[mut[
]\?/let mut \1\[/g" {} \;
This commit is contained in:
parent
5577ce635f
commit
12e8151fb0
14 changed files with 24 additions and 24 deletions
|
|
@ -11,7 +11,7 @@
|
|||
fn two_args<T>(x: T, y: T) { }
|
||||
|
||||
fn main() {
|
||||
let mut x: ~[mut int] = ~[3];
|
||||
let mut x: ~[int] = ~[3];
|
||||
let y: ~[int] = ~[3];
|
||||
let a: @mut int = @mut 3;
|
||||
let b: @int = @3;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ fn main() {
|
|||
// Note: explicit type annot is required here
|
||||
// because otherwise the inference gets smart
|
||||
// and assigns a type of ~[mut ~[const int]].
|
||||
let mut v: ~[mut ~[int]] = ~[~[0]];
|
||||
let mut v: ~[~[int]] = ~[~[0]];
|
||||
|
||||
fn f(&&v: ~[mut ~[const int]]) {
|
||||
v[0] = ~[mut 3]
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ fn main() {
|
|||
// Note: explicit type annot is required here
|
||||
// because otherwise the inference gets smart
|
||||
// and assigns a type of ~[mut ~[const int]].
|
||||
let mut v: ~[mut ~[mut int]] = ~[mut ~[0]];
|
||||
let mut v: ~[mut ~[mut int]] = ~[~[0]];
|
||||
|
||||
fn f(&&v: ~[mut ~[const int]]) {
|
||||
v[0] = ~[3]
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ fn main() {
|
|||
// Note: explicit type annot is required here
|
||||
// because otherwise the inference gets smart
|
||||
// and assigns a type of ~[mut ~[const int]].
|
||||
let mut v: ~[mut ~[mut ~[int]]] = ~[mut ~[~[0]]];
|
||||
let mut v: ~[mut ~[mut ~[int]]] = ~[~[~[0]]];
|
||||
|
||||
fn f(&&v: ~[mut ~[mut ~[const int]]]) {
|
||||
v[0][1] = ~[mut 3]
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ fn main() {
|
|||
// but we do express conflicting requirements:
|
||||
|
||||
let mut v = ~[~[0]];
|
||||
let mut w = ~[mut ~[0]];
|
||||
let mut x = ~[mut ~[0]];
|
||||
let mut w = ~[~[0]];
|
||||
let mut x = ~[~[0]];
|
||||
|
||||
fn f(&&v: ~[mut ~[int]]) {
|
||||
v[0] = ~[3]
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@
|
|||
|
||||
|
||||
|
||||
fn main() { let mut v: ~[mut int] = ~[]; }
|
||||
fn main() { let mut v: ~[int] = ~[]; }
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
fn two(it: fn(int)) { it(0); it(1); }
|
||||
|
||||
fn main() {
|
||||
let mut a: ~[mut int] = ~[-1, -1, -1, -1];
|
||||
let mut a: ~[int] = ~[-1, -1, -1, -1];
|
||||
let mut p: int = 0;
|
||||
do two |i| {
|
||||
do two |j| { a[p] = 10 * i + j; p += 1; }
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ struct Smallintmap<T> {mut v: ~[mut option<T>]}
|
|||
struct V<T> { v: ~[mut option<T>] }
|
||||
|
||||
fn mk<T>() -> @Smallintmap<T> {
|
||||
let mut v: ~[mut option<T>] = ~[];
|
||||
let mut v: ~[option<T>] = ~[];
|
||||
return @Smallintmap {mut v: move v};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
fn swap<T>(v: &[mut T], i: int, j: int) { v[i] <-> v[j]; }
|
||||
|
||||
fn main() {
|
||||
let mut a: ~[mut int] = ~[0, 1, 2, 3, 4, 5, 6];
|
||||
let mut a: ~[int] = ~[0, 1, 2, 3, 4, 5, 6];
|
||||
swap(a, 2, 4);
|
||||
assert (a[2] == 4);
|
||||
assert (a[4] == 2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue