mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
14 lines
241 B
Rust
14 lines
241 B
Rust
// check-fail
|
|
|
|
#![feature(const_option)]
|
|
|
|
const FOO: i32 = Some(42i32).unwrap();
|
|
|
|
const BAR: i32 = Option::<i32>::None.unwrap();
|
|
//~^ERROR: evaluation of constant value failed
|
|
|
|
fn main() {
|
|
println!("{}", FOO);
|
|
println!("{}", BAR);
|
|
}
|