]> git.lizzy.rs Git - rust.git/blob - src/test/ui/loops/loop-break-value.stderr
Remove E0308 note when primary label has all info
[rust.git] / src / test / ui / loops / loop-break-value.stderr
1 warning: denote infinite loops with `loop { ... }`
2   --> $DIR/loop-break-value.rs:26:5
3    |
4 LL |     'while_loop: while true {
5    |     ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
6    |
7    = note: `#[warn(while_true)]` on by default
8
9 error[E0571]: `break` with value from a `while` loop
10   --> $DIR/loop-break-value.rs:28:9
11    |
12 LL |         break ();
13    |         ^^^^^^^^ can only break with a value inside `loop` or breakable block
14    |
15 help: instead, use `break` on its own without a value inside this `while` loop
16    |
17 LL |         break;
18    |         ^^^^^
19
20 error[E0571]: `break` with value from a `while` loop
21   --> $DIR/loop-break-value.rs:30:13
22    |
23 LL |             break 'while_loop 123;
24    |             ^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
25    |
26 help: instead, use `break` on its own without a value inside this `while` loop
27    |
28 LL |             break;
29    |             ^^^^^
30
31 error[E0571]: `break` with value from a `while let` loop
32   --> $DIR/loop-break-value.rs:38:12
33    |
34 LL |         if break () {
35    |            ^^^^^^^^ can only break with a value inside `loop` or breakable block
36    |
37 help: instead, use `break` on its own without a value inside this `while let` loop
38    |
39 LL |         if break {
40    |            ^^^^^
41
42 error[E0571]: `break` with value from a `while let` loop
43   --> $DIR/loop-break-value.rs:43:9
44    |
45 LL |         break None;
46    |         ^^^^^^^^^^ can only break with a value inside `loop` or breakable block
47    |
48 help: instead, use `break` on its own without a value inside this `while let` loop
49    |
50 LL |         break;
51    |         ^^^^^
52
53 error[E0571]: `break` with value from a `while let` loop
54   --> $DIR/loop-break-value.rs:49:13
55    |
56 LL |             break 'while_let_loop "nope";
57    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
58    |
59 help: instead, use `break` on its own without a value inside this `while let` loop
60    |
61 LL |             break;
62    |             ^^^^^
63
64 error[E0571]: `break` with value from a `for` loop
65   --> $DIR/loop-break-value.rs:56:9
66    |
67 LL |         break ();
68    |         ^^^^^^^^ can only break with a value inside `loop` or breakable block
69    |
70 help: instead, use `break` on its own without a value inside this `for` loop
71    |
72 LL |         break;
73    |         ^^^^^
74
75 error[E0571]: `break` with value from a `for` loop
76   --> $DIR/loop-break-value.rs:57:9
77    |
78 LL |         break [()];
79    |         ^^^^^^^^^^ can only break with a value inside `loop` or breakable block
80    |
81 help: instead, use `break` on its own without a value inside this `for` loop
82    |
83 LL |         break;
84    |         ^^^^^
85
86 error[E0571]: `break` with value from a `for` loop
87   --> $DIR/loop-break-value.rs:64:13
88    |
89 LL |             break 'for_loop Some(17);
90    |             ^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
91    |
92 help: instead, use `break` on its own without a value inside this `for` loop
93    |
94 LL |             break;
95    |             ^^^^^
96
97 error[E0308]: mismatched types
98   --> $DIR/loop-break-value.rs:4:31
99    |
100 LL |     let val: ! = loop { break break; };
101    |                               ^^^^^ expected !, found ()
102    |
103    = note:   expected type `!`
104            found unit type `()`
105
106 error[E0308]: mismatched types
107   --> $DIR/loop-break-value.rs:11:19
108    |
109 LL |             break 123;
110    |                   ^^^ expected &str, found integer
111
112 error[E0308]: mismatched types
113   --> $DIR/loop-break-value.rs:16:15
114    |
115 LL |         break "asdf";
116    |               ^^^^^^ expected i32, found &str
117
118 error[E0308]: mismatched types
119   --> $DIR/loop-break-value.rs:21:31
120    |
121 LL |             break 'outer_loop "nope";
122    |                               ^^^^^^ expected i32, found &str
123
124 error[E0308]: mismatched types
125   --> $DIR/loop-break-value.rs:73:26
126    |
127 LL |                 break 'c 123;
128    |                          ^^^ expected (), found integer
129
130 error[E0308]: mismatched types
131   --> $DIR/loop-break-value.rs:80:15
132    |
133 LL |         break (break, break);
134    |               ^^^^^^^^^^^^^^ expected (), found tuple
135    |
136    = note: expected unit type `()`
137                   found tuple `(!, !)`
138
139 error[E0308]: mismatched types
140   --> $DIR/loop-break-value.rs:85:15
141    |
142 LL |         break 2;
143    |               ^ expected (), found integer
144
145 error[E0308]: mismatched types
146   --> $DIR/loop-break-value.rs:90:9
147    |
148 LL |         break;
149    |         ^^^^^
150    |         |
151    |         expected integer, found ()
152    |         help: give it a value of the expected type: `break value`
153
154 error: aborting due to 16 previous errors
155
156 Some errors have detailed explanations: E0308, E0571.
157 For more information about an error, try `rustc --explain E0308`.