Skip to content

Commit 8fceee6

Browse files
committed
test: De-[mut] (remove all mutable arrays from) the tests. rs=demuting
1 parent 96bdc34 commit 8fceee6

18 files changed

+25
-256
lines changed

src/test/compile-fail/assign-super.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/test/compile-fail/borrowck-assign-comp-idx.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
type point = { x: int, y: int };
1212

1313
fn a() {
14-
let mut p = ~[mut 1];
14+
let mut p = ~[1];
1515

1616
// Create an immutable pointer into p's contents:
1717
let _q: &int = &p[0]; //~ NOTE loan of mutable vec content granted here
@@ -25,7 +25,7 @@ fn b() {
2525
// here we alias the mutable vector into an imm slice and try to
2626
// modify the original:
2727

28-
let mut p = ~[mut 1];
28+
let mut p = ~[1];
2929

3030
do borrow(p) { //~ NOTE loan of mutable vec content granted here
3131
p[0] = 5; //~ ERROR assigning to mutable vec content prohibited due to outstanding loan
@@ -35,7 +35,7 @@ fn b() {
3535
fn c() {
3636
// Legal because the scope of the borrow does not include the
3737
// modification:
38-
let mut p = ~[mut 1];
38+
let mut p = ~[1];
3939
borrow(p, ||{});
4040
p[0] = 5;
4141
}

src/test/compile-fail/borrowck-loan-vec-content.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ fn takes_imm_elt(_v: &int, f: fn()) {
1717
}
1818

1919
fn has_mut_vec_and_does_not_try_to_change_it() {
20-
let v = ~[mut 1, 2, 3];
20+
let mut v = ~[1, 2, 3];
2121
do takes_imm_elt(&v[0]) {
2222
}
2323
}
2424

2525
fn has_mut_vec_but_tries_to_change_it() {
26-
let v = ~[mut 1, 2, 3];
26+
let mut v = ~[1, 2, 3];
2727
do takes_imm_elt(&v[0]) { //~ NOTE loan of mutable vec content granted here
2828
v[1] = 4; //~ ERROR assigning to mutable vec content prohibited due to outstanding loan
2929
}
@@ -34,7 +34,7 @@ fn takes_const_elt(_v: &const int, f: fn()) {
3434
}
3535

3636
fn has_mut_vec_and_tries_to_change_it() {
37-
let v = ~[mut 1, 2, 3];
37+
let mut v = ~[1, 2, 3];
3838
do takes_const_elt(&const v[0]) {
3939
v[1] = 4;
4040
}

src/test/compile-fail/borrowck-mut-slice-of-imm-vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
fn write(v: &[mut int]) {
11+
fn write(v: &mut [int]) {
1212
v[0] += 1;
1313
}
1414

src/test/compile-fail/borrowck-mut-vec-as-imm-slice-bad.rs

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/test/compile-fail/borrowck-vec-pattern-move-tail.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fn main() {
2-
let a = [mut 1, 2, 3, 4];
2+
let mut a = [1, 2, 3, 4];
33
let _ = match a {
44
[1, 2, ..tail] => tail,
55
_ => core::util::unreachable()

src/test/compile-fail/issue-2969.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
fn main()
1313
{
1414
// See #2969 -- error message should be improved
15-
let mut x = [mut 1, 2, 4];
15+
let mut x = [1, 2, 4];
1616
let v : &int = &x[2];
1717
x[2] = 6;
1818
assert *v == 6;

src/test/compile-fail/issue-3243.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// except according to those terms.
1010

1111
// xfail-test
12-
fn function() -> &[mut int] {
13-
let mut x: &static/[mut int] = &[mut 1,2,3];
12+
fn function() -> &mut [int] {
13+
let mut x: &static/mut [int] = &[1,2,3];
1414
x[0] = 12345;
1515
x //~ ERROR bad
1616
}

src/test/compile-fail/lub-in-args.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
fn two_args<T>(x: T, y: T) { }
1212

1313
fn main() {
14-
let x: ~[mut int] = ~[mut 3];
15-
let y: ~[int] = ~[3];
1614
let a: @mut int = @mut 3;
1715
let b: @int = @3;
1816

@@ -22,6 +20,5 @@ fn main() {
2220
// shortcoming of the current inference algorithm. These errors
2321
// are *not* desirable.
2422

25-
two_args(x, y); //~ ERROR (values differ in mutability)
2623
two_args(a, b); //~ ERROR (values differ in mutability)
2724
}

src/test/compile-fail/mutable-huh-variance-box.rs

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/test/compile-fail/mutable-huh-variance-deep.rs

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/test/compile-fail/mutable-huh-variance-ptr.rs

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/test/compile-fail/mutable-huh-variance-vec1.rs

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/test/compile-fail/mutable-huh-variance-vec2.rs

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/test/compile-fail/mutable-huh-variance-vec3.rs

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/test/compile-fail/mutable-huh-variance-vec4.rs

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/test/compile-fail/regions-infer-invariance-due-to-mutability-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
struct invariant {
12-
f: @[mut &int]
12+
f: @mut [&int]
1313
}
1414

1515
fn to_same_lifetime(bi: invariant/&r) {

0 commit comments

Comments
 (0)