// run-pass

#![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);
}

// run-pass

#![feature(try_trait_v2)]
#![feature(const_trait_impl)]
#![feature(const_try)]
#![feature(const_convert)]

fn main() {
    const fn foo() -> Result<bool, ()> {
        Err(())?;
        Ok(true)
    }

    const FOO: Result<bool, ()> = foo();
    assert_eq!(Err(()), FOO);
}

--- 
+++ 
@@ -6,11 +6,18 @@
 #![feature(const_convert)]
 
 fn main() {
-    const fn foo() -> Result<bool, ()> {
+    const fn result() -> Result<bool, ()> {
         Err(())?;
         Ok(true)
     }
 
-    const FOO: Result<bool, ()> = foo();
+    const FOO: Result<bool, ()> = result();
     assert_eq!(Err(()), FOO);
+
+    const fn option() -> Option<()> {
+        None?;
+        Some(())
+    }
+    const BAR: Option<()> = option();
+    assert_eq!(None, BAR);
 }
Add test for try operator with Option
