about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/never_loop.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/never_loop.rs b/tests/ui/never_loop.rs
index 2770eb2b2ab..0a21589dd0d 100644
--- a/tests/ui/never_loop.rs
+++ b/tests/ui/never_loop.rs
@@ -186,6 +186,23 @@ pub fn test16() {
     }
 }
 
+// Issue #9001: `continue` in struct expression fields
+pub fn test17() {
+    struct Foo {
+        f: (),
+    }
+
+    let mut n = 0;
+    let _ = loop {
+        break Foo {
+            f: if n < 5 {
+                n += 1;
+                continue;
+            },
+        };
+    };
+}
+
 fn main() {
     test1();
     test2();