summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const_limit/const_eval_limit_not_reached.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const_limit/const_eval_limit_not_reached.rs')
-rw-r--r--tests/ui/consts/const_limit/const_eval_limit_not_reached.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/consts/const_limit/const_eval_limit_not_reached.rs b/tests/ui/consts/const_limit/const_eval_limit_not_reached.rs
new file mode 100644
index 000000000..629d1f02a
--- /dev/null
+++ b/tests/ui/consts/const_limit/const_eval_limit_not_reached.rs
@@ -0,0 +1,20 @@
+// check-pass
+
+#![feature(const_eval_limit)]
+
+// This needs to be higher than the number of loop iterations since each pass through the loop may
+// hit more than one terminator.
+#![const_eval_limit="4000"]
+
+const X: usize = {
+ let mut x = 0;
+ while x != 1000 {
+ x += 1;
+ }
+
+ x
+};
+
+fn main() {
+ assert_eq!(X, 1000);
+}