summaryrefslogtreecommitdiffstats
path: root/tests/ui/cfg/cfg-stmt-recovery.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/cfg/cfg-stmt-recovery.rs')
-rw-r--r--tests/ui/cfg/cfg-stmt-recovery.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/cfg/cfg-stmt-recovery.rs b/tests/ui/cfg/cfg-stmt-recovery.rs
new file mode 100644
index 000000000..2e0839d2a
--- /dev/null
+++ b/tests/ui/cfg/cfg-stmt-recovery.rs
@@ -0,0 +1,13 @@
+// Verify that we do not ICE when failing to parse a statement in `cfg_eval`.
+
+#![feature(cfg_eval)]
+#![feature(stmt_expr_attributes)]
+
+#[cfg_eval]
+fn main() {
+ #[cfg_eval]
+ let _ = #[cfg(FALSE)] 0;
+ //~^ ERROR removing an expression is not supported in this position
+ //~| ERROR expected expression, found `;`
+ //~| ERROR removing an expression is not supported in this position
+}