diff options
Diffstat (limited to 'tests/ui/consts/const-try-feature-gate.rs')
| -rw-r--r-- | tests/ui/consts/const-try-feature-gate.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/consts/const-try-feature-gate.rs b/tests/ui/consts/const-try-feature-gate.rs new file mode 100644 index 00000000000..0839c23a0b9 --- /dev/null +++ b/tests/ui/consts/const-try-feature-gate.rs @@ -0,0 +1,9 @@ +// gate-test-const_try + +const fn t() -> Option<()> { + Some(())?; + //~^ error: `?` is not allowed in a `const fn` + None +} + +fn main() {} |
