Skip to content

Commit 0e64390

Browse files
committed
---
yaml --- r: 620 b: refs/heads/master c: 0d15ae4 h: refs/heads/master v: v3
1 parent 84501c9 commit 0e64390

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 6f52ba7cc52a55bf0542b9183e3bf26c52a388d9
2+
refs/heads/master: 0d15ae4f7a2429e70d7085e538e7ce305ef6a468

trunk/src/test/run-pass/alt-pattern-drop.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@ import std._str;
55

66
type t = tag(make_t(str), clam());
77

8-
fn main() {
9-
let str s = "hi"; // ref up
8+
fn foo(str s) {
109
let t x = make_t(s); // ref up
1110

1211
alt (x) {
13-
case (make_t(y)) { log y; } // ref up and ref down
12+
case (make_t(y)) { log y; } // ref up then down
1413
case (_) { log "?"; fail; }
1514
}
1615

1716
log _str.refcount(s);
18-
check (_str.refcount(s) == 2u);
17+
check (_str.refcount(s) == 3u);
18+
}
19+
20+
fn main() {
21+
let str s = "hi"; // ref up
22+
foo(s); // ref up then down
23+
log _str.refcount(s);
24+
check (_str.refcount(s) == 1u);
1925
}

0 commit comments

Comments
 (0)