]> git.lizzy.rs Git - rust.git/commitdiff
Add a test for break
authorvarkor <github@varkor.com>
Sat, 23 Jun 2018 12:21:09 +0000 (13:21 +0100)
committervarkor <github@varkor.com>
Sat, 23 Jun 2018 17:00:47 +0000 (18:00 +0100)
src/test/ui/closure-array-break-length.rs
src/test/ui/closure-array-break-length.stderr

index 4b0e941a3ce2aacef71cffd6b4fb5af2a41e322c..2e99921956ab295b1f89dc4bdfe798b7d0bb39aa 100644 (file)
@@ -12,4 +12,6 @@ fn main() {
     |_: [_; continue]| {}; //~ ERROR: `continue` outside of loop
 
     while |_: [_; continue]| {} {} //~ ERROR: `break` or `continue` with no label
+
+    while |_: [_; break]| {} {} //~ ERROR: `break` or `continue` with no label
 }
index 7cedcb254d697342a25d2d556cb63f87fe9219b0..139153992e27402d8a1fd1636ceaff4cd17c17bd 100644 (file)
@@ -10,7 +10,13 @@ error[E0590]: `break` or `continue` with no label in the condition of a `while`
 LL |     while |_: [_; continue]| {} {} //~ ERROR: `break` or `continue` with no label
    |                   ^^^^^^^^ unlabeled `continue` in the condition of a `while` loop
 
-error: aborting due to 2 previous errors
+error[E0590]: `break` or `continue` with no label in the condition of a `while` loop
+  --> $DIR/closure-array-break-length.rs:16:19
+   |
+LL |     while |_: [_; break]| {} {} //~ ERROR: `break` or `continue` with no label
+   |                   ^^^^^ unlabeled `break` in the condition of a `while` loop
+
+error: aborting due to 3 previous errors
 
 Some errors occurred: E0268, E0590.
 For more information about an error, try `rustc --explain E0268`.