Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding a test case for #2548
  • Loading branch information
eholk committed Aug 3, 2012
1 parent cc1a2f2 commit b3933b8
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/test/run-pass/issue-2548.rs
@@ -0,0 +1,27 @@
// A test case for #2548.

// xfail-test

struct foo {
x: @mut int;

new(x: @mut int) { self.x = x; }

drop {
io::println("Goodbye, World!");
*self.x += 1;
}
}

fn main() {
let x = @mut 0;

{
let mut res = foo(x);

let mut v = ~[mut];
v <- ~[mut res] + v;
}

assert *x == 1;
}

0 comments on commit b3933b8

Please sign in to comment.