]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-unwrap.rs
Rollup merge of #106949 - compiler-errors:is-poly, r=BoxyUwU
[rust.git] / tests / ui / consts / const-unwrap.rs
1 // check-fail
2
3 #![feature(const_option)]
4
5 const FOO: i32 = Some(42i32).unwrap();
6
7 const BAR: i32 = Option::<i32>::None.unwrap();
8 //~^ERROR: evaluation of constant value failed
9
10 fn main() {
11     println!("{}", FOO);
12     println!("{}", BAR);
13 }