diff options
Diffstat (limited to 'src/test/ui/for-loop-while/while-loop-constraints-2.rs')
-rw-r--r-- | src/test/ui/for-loop-while/while-loop-constraints-2.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/for-loop-while/while-loop-constraints-2.rs b/src/test/ui/for-loop-while/while-loop-constraints-2.rs new file mode 100644 index 000000000..3c5cdf06c --- /dev/null +++ b/src/test/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)); +} |