aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/obj-dtor-2.rs
blob: bbc3cc16cf166aeef2295083ebfa3f014932eb60 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// xfail-stage0
// xfail-stage1
// xfail-stage2

obj foo(@mutable int x) {
  drop {
    log "running dtor";
    *x = ((*x) + 1);
  }
}



fn main() {
  auto mbox = @mutable 10;
  {
    auto x = foo(mbox);
  }
  assert ((*mbox) == 11);
}