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);
|
2024-11-22 02:31:42 +00:00
|
|
|
x?;
|
|
|
|
|
//~^ ERROR: `?` is not allowed
|
|
|
|
|
//~| ERROR: `?` is not allowed
|
2019-11-17 21:11:42 -08:00
|
|
|
None
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {}
|