There was an error while loading. Please reload this page.
1 parent 7c8c209 commit b7f572bCopy full SHA for b7f572b
1 file changed
src/test/ui/consts/try-operator.rs
@@ -6,11 +6,18 @@
6
#![feature(const_identity_convert)]
7
8
fn main() {
9
- const fn foo() -> Result<bool, ()> {
+ const fn result() -> Result<bool, ()> {
10
Err(())?;
11
Ok(true)
12
}
13
14
- const FOO: Result<bool, ()> = foo();
+ const FOO: Result<bool, ()> = result();
15
assert_eq!(Err(()), FOO);
16
+
17
+ const fn option() -> Option<()> {
18
+ None?;
19
+ Some(())
20
+ }
21
+ const BAR: Option<()> = option();
22
+ assert_eq!(None, BAR);
23
0 commit comments