2019-11-17 21:11:42 -08:00
|
|
|
// The `?` operator is still not const-evaluatable because it calls `From::from` on the error
|
|
|
|
|
// variant.
|
|
|
|
|
|
|
|
|
|
const fn opt() -> Option<i32> {
|
|
|
|
|
let x = Some(2);
|
|
|
|
|
x?; //~ ERROR `?` is not allowed in a `const fn`
|
2024-02-01 22:45:00 +00:00
|
|
|
//~^ ERROR: cannot convert
|
|
|
|
|
//~| ERROR: cannot determine
|
2019-11-17 21:11:42 -08:00
|
|
|
None
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {}
|