Add feature const_option

This commit is contained in:
Benoît du Garreau 2020-07-01 15:07:23 +02:00
parent d462551a86
commit e7d9944e20
3 changed files with 23 additions and 4 deletions

View file

@ -0,0 +1,14 @@
// run-pass
#![feature(const_option)]
const X: Option<i32> = Some(32);
const Y: Option<&i32> = X.as_ref();
const IS_SOME: bool = X.is_some();
const IS_NONE: bool = Y.is_none();
fn main() {
assert!(IS_SOME);
assert!(!IS_NONE)
}