Skip to content

Commit ddd9fb6

Browse files
committed
Remove legacy_modes from test cases
1 parent 1bc4e3f commit ddd9fb6

31 files changed

+64
-98
lines changed

src/test/run-pass/argument-passing.rs

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

1111
// xfail-fast
12-
#[legacy_modes];
1312

1413
struct X { mut x: int }
1514

16-
fn f1(a: X, b: &mut int, -c: int) -> int {
15+
fn f1(a: &mut X, b: &mut int, -c: int) -> int {
1716
let r = a.x + *b + c;
1817
a.x = 0;
1918
*b = 10;
@@ -24,7 +23,7 @@ fn f2(a: int, f: fn(int)) -> int { f(1); return a; }
2423

2524
pub fn main() {
2625
let mut a = X {mut x: 1}, b = 2, c = 3;
27-
assert (f1(a, &mut b, c) == 6);
26+
assert (f1(&mut a, &mut b, c) == 6);
2827
assert (a.x == 0);
2928
assert (b == 10);
3029
assert (f2(a.x, |x| a.x = 50 ) == 0);

src/test/run-pass/block-iter-1.rs

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

1111
// xfail-fast
12-
#[legacy_modes];
1312

14-
fn iter_vec<T>(v: ~[T], f: fn(T)) { for v.each |x| { f(*x); } }
13+
fn iter_vec<T>(v: ~[T], f: fn(&T)) { for v.each |x| { f(x); } }
1514

1615
pub fn main() {
1716
let v = ~[1, 2, 3, 4, 5, 6, 7];
1817
let mut odds = 0;
1918
iter_vec(v, |i| {
2019
log(error, i);
21-
if i % 2 == 1 {
20+
if *i % 2 == 1 {
2221
odds += 1;
2322
}
2423
log(error, odds);

src/test/run-pass/block-iter-2.rs

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

1111
// xfail-fast
12-
#[legacy_modes];
1312

14-
fn iter_vec<T>(v: ~[T], f: fn(T)) { for v.each |x| { f(*x); } }
13+
fn iter_vec<T>(v: ~[T], f: fn(&T)) { for v.each |x| { f(x); } }
1514

1615
pub fn main() {
1716
let v = ~[1, 2, 3, 4, 5];
1817
let mut sum = 0;
1918
iter_vec(copy v, |i| {
2019
iter_vec(copy v, |j| {
21-
log(error, i * j);
22-
sum += i * j;
20+
log(error, *i * *j);
21+
sum += *i * *j;
2322
});
2423
});
2524
log(error, sum);

src/test/run-pass/closure-inference.rs

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

1111
// xfail-fast
12-
#[legacy_modes];
1312

1413
fn foo(i: int) -> int { i + 1 }
1514

src/test/run-pass/expr-alt-generic-box2.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// xfail-fast
1212
// -*- rust -*-
1313

14-
#[legacy_modes];
15-
1614
type compare<T> = fn@(T, T) -> bool;
1715

1816
fn test_generic<T:Copy>(expected: T, eq: compare<T>) {
@@ -21,7 +19,7 @@ fn test_generic<T:Copy>(expected: T, eq: compare<T>) {
2119
}
2220

2321
fn test_vec() {
24-
fn compare_box(&&v1: @int, &&v2: @int) -> bool { return v1 == v2; }
22+
fn compare_box(v1: @int, v2: @int) -> bool { return v1 == v2; }
2523
test_generic::<@int>(@1, compare_box);
2624
}
2725

src/test/run-pass/expr-alt-generic-unique2.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// xfail-fast
1212
// -*- rust -*-
1313

14-
#[legacy_modes];
15-
1614
type compare<T> = fn@(T, T) -> bool;
1715

1816
fn test_generic<T:Copy>(expected: T, eq: compare<T>) {
@@ -24,7 +22,7 @@ fn test_generic<T:Copy>(expected: T, eq: compare<T>) {
2422
}
2523

2624
fn test_vec() {
27-
fn compare_box(&&v1: ~int, &&v2: ~int) -> bool { return v1 == v2; }
25+
fn compare_box(v1: ~int, v2: ~int) -> bool { return v1 == v2; }
2826
test_generic::<~int>(~1, compare_box);
2927
}
3028

src/test/run-pass/expr-alt-generic.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// xfail-fast
1212
// -*- rust -*-
13-
#[legacy_modes];
1413

1514
type compare<T> = fn@(T, T) -> bool;
1615

@@ -20,7 +19,7 @@ fn test_generic<T:Copy>(expected: T, eq: compare<T>) {
2019
}
2120

2221
fn test_bool() {
23-
fn compare_bool(&&b1: bool, &&b2: bool) -> bool { return b1 == b2; }
22+
fn compare_bool(b1: bool, b2: bool) -> bool { return b1 == b2; }
2423
test_generic::<bool>(true, compare_bool);
2524
}
2625

src/test/run-pass/expr-block-generic.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212

1313
// xfail-fast
14-
#[legacy_modes];
1514

1615
// Tests for standalone blocks as expressions with dynamic type sizes
1716
type compare<T> = fn@(T, T) -> bool;
@@ -22,7 +21,7 @@ fn test_generic<T:Copy>(expected: T, eq: compare<T>) {
2221
}
2322

2423
fn test_bool() {
25-
fn compare_bool(&&b1: bool, &&b2: bool) -> bool { return b1 == b2; }
24+
fn compare_bool(b1: bool, b2: bool) -> bool { return b1 == b2; }
2625
test_generic::<bool>(true, compare_bool);
2726
}
2827

src/test/run-pass/expr-copy.rs

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

1111
// xfail-fast
12-
#[legacy_modes];
1312

14-
fn f(arg: A) {
13+
fn f(arg: &A) {
1514
arg.a = 100;
1615
}
1716

1817
struct A { mut a: int }
1918

2019
pub fn main() {
2120
let x = A {a: 10};
22-
f(x);
21+
f(&x);
2322
assert x.a == 100;
2423
x.a = 20;
25-
f(copy x);
24+
f(&copy x);
2625
assert x.a == 20;
2726
}

src/test/run-pass/expr-if-generic.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// xfail-fast
1212
// -*- rust -*-
13-
#[legacy_modes];
1413

1514
// Tests for if as expressions with dynamic type sizes
1615
type compare<T> = fn@(T, T) -> bool;
@@ -21,7 +20,7 @@ fn test_generic<T:Copy>(expected: T, not_expected: T, eq: compare<T>) {
2120
}
2221

2322
fn test_bool() {
24-
fn compare_bool(&&b1: bool, &&b2: bool) -> bool { return b1 == b2; }
23+
fn compare_bool(b1: bool, b2: bool) -> bool { return b1 == b2; }
2524
test_generic::<bool>(true, false, compare_bool);
2625
}
2726

0 commit comments

Comments
 (0)