f035d41b XL |
1 | enum Thing { |
2 | This, |
3 | That, |
4 | } |
60c5eb7d XL |
5 | |
6 | fn non_const() -> Thing { |
7 | Thing::This |
8 | } |
9 | |
10 | pub const Q: i32 = match non_const() { |
5099ac24 |
11 | //~^ ERROR cannot call non-const fn |
60c5eb7d XL |
12 | Thing::This => 1, |
13 | Thing::That => 0 |
14 | }; |
15 | |
16 | fn main() {} |