blob: 31fe09d4f69624e3885bbf32f25277b284ac4d9d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
// The `?` operator is still not const-evaluatable because it calls `From::from` on the error
// variant.
#![feature(const_if_match)]
const fn opt() -> Option<i32> {
let x = Some(2);
x?; //~ ERROR `?` is not allowed in a `const fn`
None
}
fn main() {}
|