aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/expr-alt-box.rs
blob: 2e7846f36c337ffa1bd2aa72a419d165a5135229 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// xfail-boot
// -*- rust -*-

// Tests for alt as expressions resulting in boxed types

fn test_box() {
  auto res = alt (true) {
    case (true) {
      @100
    }
  };
  check (*res == 100);
}

fn test_str() {
  auto res = alt (true) {
    case (true) {
      "happy"
    }
  };
  check (res == "happy");
}

fn main() {
  test_box();
  test_str();
}