60c5eb7d XL |
1 | // The `?` operator is still not const-evaluatable because it calls `From::from` on the error |
2 | // variant. |
3 | |
60c5eb7d XL |
4 | const fn opt() -> Option<i32> { |
5 | let x = Some(2); |
6 | x?; //~ ERROR `?` is not allowed in a `const fn` |
7 | None |
8 | } |
9 | |
10 | fn main() {} |