Skip to content

Commit 90c3a45

Browse files
committed
---
yaml --- r: 4607 b: refs/heads/master c: 3814d8d h: refs/heads/master i: 4605: 4a6c3eb 4603: 41d05f7 4599: 7de6e37 4591: f93aeb8 4575: 730e6d3 4543: 6f5865e 4479: b9b9568 4351: 280c87a 4095: 1cb4a68 v: v3
1 parent 9ecc17f commit 90c3a45

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: c06d95f1788f7c3b708f0be1fc452c35abf03841
2+
refs/heads/master: 3814d8d4b0fc5d31d096c4e014229445751e14e7

trunk/src/test/run-pass/vec-append.rs

+14-20
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,33 @@
33
// -*- rust -*-
44
use std;
55
import std::str;
6-
import std::vec;
7-
6+
import std::ivec;
87

98
// FIXME: import std::dbg::const_refcount. Currently
109
// cross-crate const references don't work.
1110
const const_refcount: uint = 0x7bad_face_u;
1211

1312
fn fast_growth() {
14-
let v: vec[int] = [1, 2, 3, 4, 5];
15-
v += [6, 7, 8, 9, 0];
13+
let v: [int] = ~[1, 2, 3, 4, 5];
14+
v += ~[6, 7, 8, 9, 0];
1615
log v.(9);
1716
assert (v.(0) == 1);
1817
assert (v.(7) == 8);
1918
assert (v.(9) == 0);
2019
}
2120

2221
fn slow_growth() {
23-
let v: vec[int] = [];
24-
let u: vec[int] = v;
25-
v += [17];
22+
let v: [int] = ~[];
23+
let u: [int] = v;
24+
v += ~[17];
2625
log v.(0);
2726
assert (v.(0) == 17);
2827
}
2928

3029
fn slow_growth2_helper(s: str) { // ref up: s
3130

32-
obj acc(mutable v: vec[str]) {
33-
fn add(s: &str) { v += [s]; }
31+
obj acc(mutable v: [str]) {
32+
fn add(s: &str) { v += ~[s]; }
3433
}
3534
let ss: str = s; // ref up: s
3635

@@ -47,26 +46,21 @@ fn slow_growth2_helper(s: str) { // ref up: s
4746
* mumble, the existing str in the originally- shared vec.
4847
*/
4948

50-
let v: vec[str] = [mumble]; // ref up: v, mumble
49+
let v: [str] = ~[mumble]; // ref up: mumble
5150

52-
log vec::refcount[str](v);
53-
let a: acc = acc(v); // ref up: a, v
51+
let a: acc = acc(v);
5452

55-
log vec::refcount[str](v);
56-
assert (vec::refcount[str](v) == 2u);
57-
a.add(s); // ref up: mumble, s. ref down: v
53+
a.add(s); // ref up: mumble, s
5854

59-
log vec::refcount[str](v);
6055
log str::refcount(s);
6156
log str::refcount(mumble);
62-
assert (vec::refcount[str](v) == 1u);
6357
assert (str::refcount(s) == const_refcount);
6458
assert (str::refcount(mumble) == const_refcount);
6559
log v.(0);
66-
log vec::len[str](v);
60+
log ivec::len[str](v);
6761
assert (str::eq(v.(0), mumble));
68-
assert (vec::len[str](v) == 1u);
69-
} // ref down: a, mumble, s, v
62+
assert (ivec::len[str](v) == 1u);
63+
} // ref down: mumble, s,
7064

7165
log str::refcount(s);
7266
log str::refcount(mumble);

0 commit comments

Comments
 (0)