2018-08-08 12:28:26 +00:00
|
|
|
error[E0571]: `break` with value from a `while` loop
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:28:9
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | break ();
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^^^^ can only break with a value inside `loop` or breakable block
|
|
|
|
help: instead, use `break` on its own without a value inside this `while` loop
|
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | break;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error[E0571]: `break` with value from a `while` loop
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:30:13
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | break 'while_loop 123;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
|
|
|
|
help: instead, use `break` on its own without a value inside this `while` loop
|
|
|
|
|
|
|
|
|
LL | break;
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error[E0571]: `break` with value from a `while let` loop
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:38:12
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | if break () {
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^^^^ can only break with a value inside `loop` or breakable block
|
|
|
|
help: instead, use `break` on its own without a value inside this `while let` loop
|
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | if break {
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error[E0571]: `break` with value from a `while let` loop
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:43:9
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | break None;
|
|
|
|
| ^^^^^^^^^^ can only break with a value inside `loop` or breakable block
|
|
|
|
help: instead, use `break` on its own without a value inside this `while let` loop
|
|
|
|
|
|
|
|
|
LL | break;
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error[E0571]: `break` with value from a `while let` loop
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:49:13
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | break 'while_let_loop "nope";
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
|
|
|
|
help: instead, use `break` on its own without a value inside this `while let` loop
|
|
|
|
|
|
|
|
|
LL | break;
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error[E0571]: `break` with value from a `for` loop
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:56:9
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | break ();
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^^^^ can only break with a value inside `loop` or breakable block
|
|
|
|
help: instead, use `break` on its own without a value inside this `for` loop
|
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | break;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error[E0571]: `break` with value from a `for` loop
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:57:9
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | break [()];
|
|
|
|
| ^^^^^^^^^^ can only break with a value inside `loop` or breakable block
|
|
|
|
help: instead, use `break` on its own without a value inside this `for` loop
|
|
|
|
|
|
|
|
|
LL | break;
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error[E0571]: `break` with value from a `for` loop
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:64:13
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | break 'for_loop Some(17);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
|
|
|
|
help: instead, use `break` on its own without a value inside this `for` loop
|
|
|
|
|
|
|
|
|
LL | break;
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:4:31
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let val: ! = loop { break break; };
|
|
|
|
| ^^^^^ expected (), found !
|
|
|
|
|
|
|
|
|
= note: expected type `()`
|
|
|
|
found type `!`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:11:19
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | break 123;
|
2019-01-01 01:43:08 +00:00
|
|
|
| ^^^ expected &str, found integer
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
= note: expected type `&str`
|
|
|
|
found type `{integer}`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:16:15
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | break "asdf";
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^^ expected i32, found reference
|
|
|
|
|
|
|
|
|
= note: expected type `i32`
|
|
|
|
found type `&'static str`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:21:31
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | break 'outer_loop "nope";
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^^ expected i32, found reference
|
|
|
|
|
|
|
|
|
= note: expected type `i32`
|
|
|
|
found type `&'static str`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:73:26
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | break 'c 123;
|
2019-01-01 01:43:08 +00:00
|
|
|
| ^^^ expected (), found integer
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
= note: expected type `()`
|
|
|
|
found type `{integer}`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:80:15
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | break (break, break);
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^^^^^^^^^^ expected (), found tuple
|
|
|
|
|
|
|
|
|
= note: expected type `()`
|
|
|
|
found type `(!, !)`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:85:15
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | break 2;
|
2019-01-01 01:43:08 +00:00
|
|
|
| ^ expected (), found integer
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
= note: expected type `()`
|
|
|
|
found type `{integer}`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/loop-break-value.rs:90:9
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | break;
|
2019-01-01 01:43:08 +00:00
|
|
|
| ^^^^^ expected (), found integer
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
= note: expected type `()`
|
|
|
|
found type `{integer}`
|
|
|
|
|
|
|
|
error: aborting due to 16 previous errors
|
|
|
|
|
2019-04-17 17:26:38 +00:00
|
|
|
Some errors have detailed explanations: E0308, E0571.
|
2018-08-08 12:28:26 +00:00
|
|
|
For more information about an error, try `rustc --explain E0308`.
|