提交 5144f790 编写于 作者: M Marijn Haverbeke

Fix and un-xfail vec-append test

上级 75ffe657
......@@ -336,8 +336,9 @@ fn refcount(str s) -> uint {
if (r == dbg::const_refcount) {
ret r;
} else {
// -1 because calling this function incremented the refcount.
ret r - 1u;
// -2 because calling this function and the native function both
// incremented the refcount.
ret r - 2u;
}
}
......
......@@ -50,8 +50,9 @@ fn refcount[T](array[T] v) -> uint {
if (r == dbg::const_refcount) {
ret r;
} else {
// -1 because calling this function incremented the refcount.
ret r - 1u;
// -2 because calling this function and the native function both
// incremented the refcount.
ret r - 2u;
}
}
......
// xfail-stage0
// xfail-stage1
// xfail-stage2
// -*- rust -*-
use std;
......@@ -51,13 +48,13 @@ fn slow_growth2_helper(str s) { // ref up: s
* mumble, the existing str in the originally- shared vec.
*/
let vec[str] v = [mumble]; // ref up: v, mumble
log vec::refcount[str](v);
let acc a = acc(v); // ref up: a, v
log vec::refcount[str](v);
assert (vec::refcount[str](v) == 2u);
a.add(s); // ref up: mumble, s. ref down: v
log vec::refcount[str](v);
log str::refcount(s);
log str::refcount(mumble);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册