Skip to content

Commit b3933b8

Browse files
committed
Adding a test case for #2548
1 parent cc1a2f2 commit b3933b8

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// A test case for #2548.
2+
3+
// xfail-test
4+
5+
struct foo {
6+
x: @mut int;
7+
8+
new(x: @mut int) { self.x = x; }
9+
10+
drop {
11+
io::println("Goodbye, World!");
12+
*self.x += 1;
13+
}
14+
}
15+
16+
fn main() {
17+
let x = @mut 0;
18+
19+
{
20+
let mut res = foo(x);
21+
22+
let mut v = ~[mut];
23+
v <- ~[mut res] + v;
24+
}
25+
26+
assert *x == 1;
27+
}

0 commit comments

Comments
 (0)