diff options
Diffstat (limited to 'tests/ui/for-loop-while/liveness-loop-break.rs')
-rw-r--r-- | tests/ui/for-loop-while/liveness-loop-break.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/for-loop-while/liveness-loop-break.rs b/tests/ui/for-loop-while/liveness-loop-break.rs new file mode 100644 index 000000000..60a63bccb --- /dev/null +++ b/tests/ui/for-loop-while/liveness-loop-break.rs @@ -0,0 +1,13 @@ +// run-pass +fn test() { + let v; + loop { + v = 3; + break; + } + println!("{}", v); +} + +pub fn main() { + test(); +} |