mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-02 13:07:37 +00:00
13 lines
263 B
Rust
13 lines
263 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
|
|
//~| ERROR: `?` is not allowed
|
|
None
|
|
}
|
|
|
|
fn main() {}
|