2020-07-30 14:32:20 -05:00
|
|
|
// check-fail
|
|
|
|
|
|
|
|
#![feature(const_option)]
|
|
|
|
|
|
|
|
const FOO: i32 = Some(42i32).unwrap();
|
|
|
|
|
2021-07-09 08:21:58 -05:00
|
|
|
const BAR: i32 = Option::<i32>::None.unwrap();
|
|
|
|
//~^ERROR: evaluation of constant value failed
|
2020-07-30 14:32:20 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
println!("{}", FOO);
|
|
|
|
println!("{}", BAR);
|
|
|
|
}
|