summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-try-feature-gate.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/consts/const-try-feature-gate.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-try-feature-gate.rs b/src/test/ui/consts/const-try-feature-gate.rs
new file mode 100644
index 000000000..0839c23a0
--- /dev/null
+++ b/src/test/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() {}