mirror of
https://git.proxmox.com/git/rustc
synced 2026-03-28 11:51:07 +00:00
13 lines
302 B
Rust
13 lines
302 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`
|
|
//~^ ERROR: cannot convert
|
|
//~| ERROR: cannot determine
|
|
None
|
|
}
|
|
|
|
fn main() {}
|