We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f52ba7 commit 0d15ae4Copy full SHA for 0d15ae4
src/test/run-pass/alt-pattern-drop.rs
@@ -5,15 +5,21 @@ import std._str;
5
6
type t = tag(make_t(str), clam());
7
8
-fn main() {
9
- let str s = "hi"; // ref up
+fn foo(str s) {
10
let t x = make_t(s); // ref up
11
12
alt (x) {
13
- case (make_t(y)) { log y; } // ref up and ref down
+ case (make_t(y)) { log y; } // ref up then down
14
case (_) { log "?"; fail; }
15
}
16
17
log _str.refcount(s);
18
- check (_str.refcount(s) == 2u);
+ check (_str.refcount(s) == 3u);
+}
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);
25
0 commit comments