Skip to content

Commit b972cad

Browse files
committed
Update/delete tests using @[].
1 parent f63c3fb commit b972cad

21 files changed

+9
-128
lines changed

src/test/compile-fail/auto-ref-slice-plus-ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn main() {
1717
// reference. That would allow creating a mutable pointer to a
1818
// temporary, which would be a source of confusion
1919

20-
let mut a = @[0];
20+
let mut a = ~[0];
2121
a.test_mut(); //~ ERROR does not implement any method in scope named `test_mut`
2222
}
2323

src/test/compile-fail/drop-on-non-struct.rs

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

1111
#[feature(managed_boxes)];
1212

13-
type Foo = @[u8];
13+
type Foo = ~[u8];
1414

1515
impl Drop for Foo { //~ ERROR the Drop trait may only be implemented
1616
//~^ ERROR cannot provide an extension implementation

src/test/compile-fail/evec-subtyping.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,20 @@
1010

1111
#[feature(managed_boxes)];
1212

13-
fn wants_box(x: @[uint]) { }
1413
fn wants_uniq(x: ~[uint]) { }
1514
fn wants_three(x: [uint, ..3]) { }
1615

17-
fn has_box(x: @[uint]) {
18-
wants_box(x);
19-
wants_uniq(x); //~ ERROR [] storage differs: expected `~` but found `@`
20-
wants_three(x); //~ ERROR [] storage differs: expected `3` but found `@`
21-
}
22-
2316
fn has_uniq(x: ~[uint]) {
24-
wants_box(x); //~ ERROR [] storage differs: expected `@` but found `~`
2517
wants_uniq(x);
2618
wants_three(x); //~ ERROR [] storage differs: expected `3` but found `~`
2719
}
2820

2921
fn has_three(x: [uint, ..3]) {
30-
wants_box(x); //~ ERROR [] storage differs: expected `@` but found `3`
3122
wants_uniq(x); //~ ERROR [] storage differs: expected `~` but found `3`
3223
wants_three(x);
3324
}
3425

3526
fn has_four(x: [uint, ..4]) {
36-
wants_box(x); //~ ERROR [] storage differs: expected `@` but found `4`
3727
wants_uniq(x); //~ ERROR [] storage differs: expected `~` but found `4`
3828
wants_three(x); //~ ERROR [] storage differs: expected `3` but found `4`
3929
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@
1111
#[feature(managed_boxes)];
1212

1313
static x: ~[int] = ~[123, 456]; //~ ERROR: cannot allocate vectors in constant expressions
14-
static y: @[int] = @[123, 456]; //~ ERROR: cannot allocate vectors in constant expressions
1514

1615
fn main() {}

src/test/compile-fail/lint-heap-memory.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ fn main() {
2222
let _x : Bar = Bar {x : ~10}; //~ ERROR type uses owned
2323

2424
@2; //~ ERROR type uses managed
25-
@[1]; //~ ERROR type uses managed
26-
//~^ ERROR type uses managed
25+
2726
fn f(_: @Clone) {} //~ ERROR type uses managed
2827

2928
~2; //~ ERROR type uses owned

src/test/compile-fail/moves-based-on-type-exprs.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ fn f80() {
7272
touch(&x); //~ ERROR use of moved value: `x`
7373
}
7474

75-
fn f90() {
76-
let x = ~"hi";
77-
let _y = @[x];
78-
touch(&x); //~ ERROR use of moved value: `x`
79-
}
80-
8175
fn f100() {
8276
let x = ~[~"hi"];
8377
let _y = x[0];

src/test/debug-info/boxed-vec.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,15 @@
1717
// debugger:run
1818
// debugger:finish
1919

20-
// debugger:print managed->val.fill
21-
// check:$1 = 24
22-
// debugger:print *((uint64_t[3]*)(managed->val.elements))
23-
// check:$2 = {7, 8, 9}
24-
2520
// debugger:print unique->fill
26-
// check:$3 = 32
21+
// check:$1 = 32
2722
// debugger:print *((uint64_t[4]*)(unique->elements))
28-
// check:$4 = {10, 11, 12, 13}
23+
// check:$2 = {10, 11, 12, 13}
2924

3025
#[allow(unused_variable)];
3126

3227
fn main() {
3328

34-
let managed: @[i64] = @[7, 8, 9];
3529
let unique: ~[i64] = ~[10, 11, 12, 13];
3630

3731
zzz();

src/test/run-pass/auto-encode.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,6 @@ pub fn main() {
144144
let a = &Point {x: 3u, y: 5u};
145145
test_ebml(a);
146146

147-
let a = &@[1u, 2u, 3u];
148-
test_ebml(a);
149-
150147
let a = &Top(22u);
151148
test_ebml(a);
152149

src/test/run-pass/auto-ref-slice-plus-ref.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ pub fn main() {
3030

3131
([1]).test_imm();
3232
(~[1]).test_imm();
33-
(@[1]).test_imm();
3433
(&[1]).test_imm();
3534
("test").test_imm();
3635
(~"test").test_imm();

src/test/run-pass/borrowck-borrow-from-at-vec.rs

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

src/test/run-pass/expr-repeat-vstore.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,4 @@ pub fn main() {
77
println!("{}", v[2]);
88
println!("{}", v[3]);
99
println!("{}", v[4]);
10-
let v: @[int] = @[ 2, ..5 ];
11-
println!("{}", v[0]);
12-
println!("{}", v[1]);
13-
println!("{}", v[2]);
14-
println!("{}", v[3]);
15-
println!("{}", v[4]);
1610
}

src/test/run-pass/issue-5926.rs

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

src/test/run-pass/issue-9382.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ pub fn main() {
3535
baz: ~[],
3636
bar: ~32,
3737
};
38-
let _t1_at = Thing1 {
39-
baz: @[],
40-
bar: ~32,
41-
};
4238
let _t2_fixed = Thing2 {
4339
baz: &[],
4440
bar: 32,
@@ -47,8 +43,4 @@ pub fn main() {
4743
baz: ~[],
4844
bar: 32,
4945
};
50-
let _t2_at = Thing2 {
51-
baz: @[],
52-
bar: 32,
53-
};
5446
}

src/test/run-pass/nullable-pointer-iotareduction.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ pub fn main() {
8080
check_type!(@19: @int);
8181
check_type!(~"foo": ~str);
8282
check_type!(~[20, 22]: ~[int]);
83-
check_type!(@[]: @[int]);
84-
check_type!(@[24, 26]: @[int]);
8583
let mint: uint = unsafe { cast::transmute(main) };
8684
check_type!(main: extern fn(), |pthing| {
8785
assert!(mint == unsafe { cast::transmute(*pthing) })

src/test/run-pass/nullable-pointer-size.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,5 @@ pub fn main() {
4242
check_type!(@int);
4343
check_type!(~str);
4444
check_type!(~[int]);
45-
check_type!(@[int]);
4645
check_type!(extern fn());
4746
}

src/test/run-pass/packed-struct-generic-size.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ pub fn main() {
2222

2323
assert_eq!(mem::size_of::<S<u64, u16>>(), 11);
2424

25-
assert_eq!(mem::size_of::<S<~str, @[int]>>(),
26-
1 + mem::size_of::<~str>() + mem::size_of::<@[int]>());
25+
assert_eq!(mem::size_of::<S<~str, ~[int]>>(),
26+
1 + mem::size_of::<~str>() + mem::size_of::<~[int]>());
2727
}

src/test/run-pass/reflect-visit-data.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,6 @@ impl<V:TyVisitor + movable_ptr> TyVisitor for ptr_visit_adaptor<V> {
252252
}
253253

254254
fn visit_evec_box(&mut self, mtbl: uint, inner: *TyDesc) -> bool {
255-
self.align_to::<@[u8]>();
256-
if ! self.inner().visit_evec_box(mtbl, inner) { return false; }
257-
self.bump_past::<@[u8]>();
258255
true
259256
}
260257

src/test/run-pass/regions-borrow-evec-at.rs

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

src/test/run-pass/repeated-vector-syntax.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct Foo {
1616
}
1717

1818
pub fn main() {
19-
let x = [ @[true], ..512 ];
19+
let x = [ [true], ..512 ];
2020
let y = [ 0, ..1 ];
2121

2222
error!("{:?}", x);

src/test/run-pass/vec-matching-autoslice.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
#[feature(managed_boxes)];
2-
31
pub fn main() {
4-
let x = @[1, 2, 3];
2+
let x = ~[1, 2, 3];
53
match x {
64
[2, ..] => fail!(),
75
[1, ..tail] => {

src/test/run-pass/vec-to_str.rs

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

11-
#[feature(managed_boxes)];
12-
1311
pub fn main() {
1412
assert_eq!((~[0, 1]).to_str(), ~"[0, 1]");
1513
assert_eq!((&[1, 2]).to_str(), ~"[1, 2]");
16-
assert_eq!((@[2, 3]).to_str(), ~"[2, 3]");
1714
1815
let foo = ~[3, 4];
1916
let bar = &[4, 5];
20-
let baz = @[5, 6];
2117
2218
assert_eq!(foo.to_str(), ~"[3, 4]");
2319
assert_eq!(bar.to_str(), ~"[4, 5]");
24-
assert_eq!(baz.to_str(), ~"[5, 6]");
25-
2620
}

0 commit comments

Comments
 (0)