about summary refs log tree commit diff
path: root/tests/ui/for-loop-while/while-loop-constraints-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/for-loop-while/while-loop-constraints-2.rs')
-rw-r--r--tests/ui/for-loop-while/while-loop-constraints-2.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/for-loop-while/while-loop-constraints-2.rs b/tests/ui/for-loop-while/while-loop-constraints-2.rs
new file mode 100644
index 00000000000..3c5cdf06cd8
--- /dev/null
+++ b/tests/ui/for-loop-while/while-loop-constraints-2.rs
@@ -0,0 +1,15 @@
+// run-pass
+#![allow(unused_assignments)]
+#![allow(unused_variables)]
+
+pub fn main() {
+    let mut y: isize = 42;
+    let mut z: isize = 42;
+    let mut x: isize;
+    while z < 50 {
+        z += 1;
+        while false { x = y; y = z; }
+        println!("{}", y);
+    }
+    assert!((y == 42 && z == 50));
+}