Skip to content

Commit 6605cde

Browse files
committed
test: Remove #[legacy_modes] from the test suite.
1 parent 1815c1e commit 6605cde

23 files changed

+28
-51
lines changed

src/libcore/sys.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ pub fn pref_align_of_val<T>(_val: &T) -> uint {
155155
pub fn refcount<T>(t: @T) -> uint {
156156
unsafe {
157157
let ref_ptr: *uint = cast::transmute(t);
158-
*ref_ptr
158+
*ref_ptr - 1
159159
}
160160
}
161161

src/librustc/middle/trans/foreign.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -773,11 +773,11 @@ pub fn trans_intrinsic(ccx: @CrateContext,
773773
~"visit_tydesc" => {
774774
let td = get_param(decl, first_real_arg);
775775
let visitor = get_param(decl, first_real_arg + 1u);
776-
let llvisitorptr = alloca(bcx, val_ty(visitor));
777-
Store(bcx, visitor, llvisitorptr);
776+
//let llvisitorptr = alloca(bcx, val_ty(visitor));
777+
//Store(bcx, visitor, llvisitorptr);
778778
let td = PointerCast(bcx, td, T_ptr(ccx.tydesc_type));
779779
glue::call_tydesc_glue_full(bcx,
780-
llvisitorptr,
780+
visitor,
781781
td,
782782
abi::tydesc_field_visit_glue,
783783
None);

src/test/auxiliary/cci_iter_lib.rs

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

1111
#[link(name="cci_iter_lib", vers="0.0")];
12-
#[legacy_modes];
1312

1413
#[inline]
15-
pub fn iter<T>(v: ~[T], f: &fn(T)) {
14+
pub fn iter<T>(v: &[T], f: &fn(&T)) {
1615
let mut i = 0u;
1716
let n = vec::len(v);
1817
while i < n {
19-
f(v[i]);
18+
f(&v[i]);
2019
i += 1u;
2120
}
2221
}

src/test/auxiliary/cci_nested_lib.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,21 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[legacy_modes];
12-
13-
pub struct Entry<A,B> {key: A, value: B}
11+
pub struct Entry<A,B> {
12+
key: A,
13+
value: B
14+
}
1415

15-
pub struct alist<A,B> { eq_fn: @fn(A,A) -> bool, data: @mut ~[Entry<A,B>] }
16+
pub struct alist<A,B> {
17+
eq_fn: @fn(A,A) -> bool,
18+
data: @mut ~[Entry<A,B>]
19+
}
1620

17-
pub fn alist_add<A:Copy,B:Copy>(lst: alist<A,B>, k: A, v: B) {
21+
pub fn alist_add<A:Copy,B:Copy>(lst: &alist<A,B>, k: A, v: B) {
1822
lst.data.push(Entry{key:k, value:v});
1923
}
2024

21-
pub fn alist_get<A:Copy,B:Copy>(lst: alist<A,B>, k: A) -> B {
25+
pub fn alist_get<A:Copy,B:Copy>(lst: &alist<A,B>, k: A) -> B {
2226
let eq_fn = lst.eq_fn;
2327
for lst.data.each |entry| {
2428
if eq_fn(entry.key, k) { return entry.value; }
@@ -28,13 +32,13 @@ pub fn alist_get<A:Copy,B:Copy>(lst: alist<A,B>, k: A) -> B {
2832

2933
#[inline]
3034
pub fn new_int_alist<B:Copy>() -> alist<int, B> {
31-
fn eq_int(&&a: int, &&b: int) -> bool { a == b }
35+
fn eq_int(a: int, b: int) -> bool { a == b }
3236
return alist {eq_fn: eq_int, data: @mut ~[]};
3337
}
3438

3539
#[inline]
3640
pub fn new_int_alist_2<B:Copy>() -> alist<int, B> {
3741
#[inline]
38-
fn eq_int(&&a: int, &&b: int) -> bool { a == b }
42+
fn eq_int(a: int, b: int) -> bool { a == b }
3943
return alist {eq_fn: eq_int, data: @mut ~[]};
4044
}

src/test/bench/graph500-bfs.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
// option. This file may not be copied, modified, or distributed
1111
// except according to those terms.
1212

13-
#[legacy_modes];
1413
#[allow(deprecated_mode)];
1514

1615
/*!

src/test/bench/msgsend-pipes-shared.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
// different scalability characteristics compared to the select
1919
// version.
2020

21-
#[legacy_modes];
22-
2321
extern mod std;
2422
use core::io::Writer;
2523
use core::io::WriterUtil;

src/test/bench/msgsend-pipes.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
//
1515
// I *think* it's the same, more or less.
1616

17-
#[legacy_modes];
18-
1917
extern mod std;
2018
use core::io::Writer;
2119
use core::io::WriterUtil;

src/test/bench/shootout-k-nucleotide-pipes.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// xfail-pretty (extra blank line is inserted in vec::mapi call)
1212
// multi tasking k-nucleotide
1313

14-
#[legacy_modes];
15-
1614
extern mod std;
1715
use std::sort;
1816
use core::hashmap::HashMap;
@@ -105,9 +103,9 @@ fn windows_with_carry(bb: &[u8], nn: uint,
105103
return vec::slice(bb, len - (nn - 1u), len).to_vec();
106104
}
107105

108-
fn make_sequence_processor(sz: uint, from_parent: comm::Port<~[u8]>,
106+
fn make_sequence_processor(sz: uint,
107+
from_parent: comm::Port<~[u8]>,
109108
to_parent: comm::Chan<~str>) {
110-
111109
let mut freqs: HashMap<~[u8], uint> = HashMap::new();
112110
let mut carry: ~[u8] = ~[];
113111
let mut total: uint = 0u;

src/test/bench/shootout-pfib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
2020
*/
2121

22-
#[legacy_modes];
23-
2422
extern mod std;
2523

2624
use std::{time, getopts};

src/test/compile-fail/fn-variance-1.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[legacy_modes];
12-
13-
fn takes_mut(&&x: @mut int) { }
14-
fn takes_imm(&&x: @int) { }
11+
fn takes_mut(x: @mut int) { }
12+
fn takes_imm(x: @int) { }
1513

1614
fn apply<T>(t: T, f: &fn(T)) {
1715
f(t)

src/test/compile-fail/mode-inference-fail.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[legacy_modes];
12-
1311
// In this test, the mode gets inferred to ++ due to the apply_int(),
1412
// but then we get a failure in the generic apply().
1513

src/test/compile-fail/regions-creating-enums.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[legacy_modes];
12-
1311
enum ast<'self> {
1412
num(uint),
1513
add(&'self ast<'self>, &'self ast<'self>)

src/test/run-pass-fulldeps/qquote.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// xfail-pretty
1212

13-
#[legacy_modes];
14-
1513
extern mod std;
1614
extern mod syntax;
1715

src/test/run-pass/cci_iter_exe.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
// xfail-fast - check-fast doesn't understand aux-build
1212
// aux-build:cci_iter_lib.rs
1313

14-
#[legacy_modes];
15-
1614
extern mod cci_iter_lib;
1715

1816
pub fn main() {

src/test/run-pass/class-implement-traits.rs

Lines changed: 3 additions & 2 deletions
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
trait noisy {
1514
fn speak(&mut self);
@@ -66,6 +65,8 @@ pub fn main() {
6665
let mut nyan = cat(0u, 2, ~"nyan");
6766
nyan.eat();
6867
assert!((!nyan.eat()));
69-
for uint::range(1u, 10u) |_i| { make_speak(nyan); };
68+
for uint::range(1u, 10u) |_i| {
69+
make_speak(copy nyan);
70+
}
7071
assert!((nyan.eat()));
7172
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
// except according to those terms.
1111

1212
// xfail-fast
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_vec() {
23-
fn compare_vec(&&v1: @int, &&v2: @int) -> bool { return v1 == v2; }
22+
fn compare_vec(v1: @int, v2: @int) -> bool { return v1 == v2; }
2423
test_generic::<@int>(@1, compare_vec);
2524
}
2625

src/test/run-pass/expr-block-generic-unique2.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_vec() {
23-
fn compare_vec(&&v1: ~int, &&v2: ~int) -> bool { return v1 == v2; }
22+
fn compare_vec(v1: ~int, v2: ~int) -> bool { return v1 == v2; }
2423
test_generic::<~int>(~1, compare_vec);
2524
}
2625

src/test/run-pass/expr-if-generic-box2.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, not_expected: T, eq: compare<T>) {
2019
}
2120

2221
fn test_vec() {
23-
fn compare_box(&&v1: @int, &&v2: @int) -> bool { return v1 == v2; }
22+
fn compare_box(v1: @int, v2: @int) -> bool { return v1 == v2; }
2423
test_generic::<@int>(@1, @2, compare_box);
2524
}
2625

src/test/run-pass/intrinsic-frame-address.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
mod rusti {
1514
#[abi = "rust-intrinsic"]

src/test/run-pass/static-method-test.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
// A trait for objects that can be used to do an if-then-else
1514
// (No actual need for this to be static, but it is a simple test.)

src/test/run-pass/task-comm-0.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
extern mod std;
1514

src/test/run-pass/task-comm-13.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
extern mod std;
1514

src/test/run-pass/task-comm-7.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
extern mod std;
1514

0 commit comments

Comments
 (0)