1 error[E0571]: `break` with value from a `while` loop
2 --> $DIR/loop-break-value.rs:28:9
4 LL | break (); //~ ERROR `break` with value from a `while` loop
5 | ^^^^^^^^ can only break with a value inside `loop` or breakable block
6 help: instead, use `break` on its own without a value inside this `while` loop
8 LL | break; //~ ERROR `break` with value from a `while` loop
11 error[E0571]: `break` with value from a `while` loop
12 --> $DIR/loop-break-value.rs:30:13
14 LL | break 'while_loop 123;
15 | ^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
16 help: instead, use `break` on its own without a value inside this `while` loop
21 error[E0571]: `break` with value from a `while let` loop
22 --> $DIR/loop-break-value.rs:38:12
24 LL | if break () { //~ ERROR `break` with value from a `while let` loop
25 | ^^^^^^^^ can only break with a value inside `loop` or breakable block
26 help: instead, use `break` on its own without a value inside this `while let` loop
28 LL | if break { //~ ERROR `break` with value from a `while let` loop
31 error[E0571]: `break` with value from a `while let` loop
32 --> $DIR/loop-break-value.rs:43:9
35 | ^^^^^^^^^^ can only break with a value inside `loop` or breakable block
36 help: instead, use `break` on its own without a value inside this `while let` loop
41 error[E0571]: `break` with value from a `while let` loop
42 --> $DIR/loop-break-value.rs:49:13
44 LL | break 'while_let_loop "nope";
45 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
46 help: instead, use `break` on its own without a value inside this `while let` loop
51 error[E0571]: `break` with value from a `for` loop
52 --> $DIR/loop-break-value.rs:56:9
54 LL | break (); //~ ERROR `break` with value from a `for` loop
55 | ^^^^^^^^ can only break with a value inside `loop` or breakable block
56 help: instead, use `break` on its own without a value inside this `for` loop
58 LL | break; //~ ERROR `break` with value from a `for` loop
61 error[E0571]: `break` with value from a `for` loop
62 --> $DIR/loop-break-value.rs:57:9
65 | ^^^^^^^^^^ can only break with a value inside `loop` or breakable block
66 help: instead, use `break` on its own without a value inside this `for` loop
71 error[E0571]: `break` with value from a `for` loop
72 --> $DIR/loop-break-value.rs:64:13
74 LL | break 'for_loop Some(17);
75 | ^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
76 help: instead, use `break` on its own without a value inside this `for` loop
81 error[E0308]: mismatched types
82 --> $DIR/loop-break-value.rs:4:31
84 LL | let val: ! = loop { break break; };
85 | ^^^^^ expected (), found !
87 = note: expected type `()`
90 error[E0308]: mismatched types
91 --> $DIR/loop-break-value.rs:11:19
93 LL | break 123; //~ ERROR mismatched types
94 | ^^^ expected &str, found integer
96 = note: expected type `&str`
97 found type `{integer}`
99 error[E0308]: mismatched types
100 --> $DIR/loop-break-value.rs:16:15
102 LL | break "asdf"; //~ ERROR mismatched types
103 | ^^^^^^ expected i32, found reference
105 = note: expected type `i32`
106 found type `&'static str`
108 error[E0308]: mismatched types
109 --> $DIR/loop-break-value.rs:21:31
111 LL | break 'outer_loop "nope"; //~ ERROR mismatched types
112 | ^^^^^^ expected i32, found reference
114 = note: expected type `i32`
115 found type `&'static str`
117 error[E0308]: mismatched types
118 --> $DIR/loop-break-value.rs:73:26
120 LL | break 'c 123; //~ ERROR mismatched types
121 | ^^^ expected (), found integer
123 = note: expected type `()`
124 found type `{integer}`
126 error[E0308]: mismatched types
127 --> $DIR/loop-break-value.rs:80:15
129 LL | break (break, break); //~ ERROR mismatched types
130 | ^^^^^^^^^^^^^^ expected (), found tuple
132 = note: expected type `()`
135 error[E0308]: mismatched types
136 --> $DIR/loop-break-value.rs:85:15
138 LL | break 2; //~ ERROR mismatched types
139 | ^ expected (), found integer
141 = note: expected type `()`
142 found type `{integer}`
144 error[E0308]: mismatched types
145 --> $DIR/loop-break-value.rs:90:9
147 LL | break; //~ ERROR mismatched types
148 | ^^^^^ expected (), found integer
150 = note: expected type `()`
151 found type `{integer}`
153 error: aborting due to 16 previous errors
155 Some errors occurred: E0308, E0571.
156 For more information about an error, try `rustc --explain E0308`.