aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/expr-if-box.rs
blob: 98503211fc2c3fd99b19ebba22e9dd869ba58770 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// xfail-boot
// xfail-stage0
// -*- rust -*-

// Tests for if as expressions returning boxed types

fn test_box() {
  auto res = if (true) { @100 } else { @101 };
  check (*res == 100);
}

fn main() {
  test_box();
}