aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/while-prelude-drop.rs
blob: 18f259a77d8cd9082ece8d6e4704f0965751e11e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
tag t {
  a;
  b(str);
}

fn make(int i) -> t {
  if (i > 10) {
    ret a;
  }
  auto s = "hello";
  // Ensure s is non-const.
  s += "there";
  ret b(s);
}

fn main() {
  auto i = 0;
  // The auto slot for the result of make(i) should not leak.
  while (make(i) != a) {
    i += 1;
  }
}