mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
11 lines
238 B
Rust
11 lines
238 B
Rust
// 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`
|
|
None
|
|
}
|
|
|
|
fn main() {}
|