2023-04-16 06:12:37 -05:00
|
|
|
//@ known-bug: #110395
|
2021-12-05 04:46:29 -06:00
|
|
|
|
|
|
|
#![feature(try_trait_v2)]
|
|
|
|
#![feature(const_trait_impl)]
|
|
|
|
#![feature(const_try)]
|
|
|
|
#![feature(const_convert)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
const fn result() -> Result<bool, ()> {
|
|
|
|
Err(())?;
|
|
|
|
Ok(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
const FOO: Result<bool, ()> = result();
|
|
|
|
assert_eq!(Err(()), FOO);
|
|
|
|
|
|
|
|
const fn option() -> Option<()> {
|
|
|
|
None?;
|
|
|
|
Some(())
|
|
|
|
}
|
|
|
|
const BAR: Option<()> = option();
|
|
|
|
assert_eq!(None, BAR);
|
|
|
|
}
|