From a013568f70ab5099f269c5f86eeca5f71d1275e6 Mon Sep 17 00:00:00 2001 From: Cameron Steffen Date: Thu, 5 Oct 2017 23:46:08 -0500 Subject: [PATCH] add never_loop tests --- tests/ui/never_loop.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/ui/never_loop.rs b/tests/ui/never_loop.rs index 715a83efd93..3bb25f68840 100644 --- a/tests/ui/never_loop.rs +++ b/tests/ui/never_loop.rs @@ -139,6 +139,19 @@ pub fn test13() { } } +pub fn test14() { + let mut a = true; + 'outer: while a { // never loops + while a { + if a { + a = false; + continue + } + } + break 'outer; + } +} + fn main() { test1(); test2(); @@ -153,5 +166,6 @@ fn main() { test11(|| 0); test12(true, false); test13(); + test14(); }