]> git.proxmox.com Git - rustc.git/blob - src/test/ui/loops/loop-break-value.stderr
New upstream version 1.33.0+dfsg1
[rustc.git] / src / test / ui / loops / loop-break-value.stderr
1 error[E0571]: `break` with value from a `while` loop
2 --> $DIR/loop-break-value.rs:28:9
3 |
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
7 |
8 LL | break; //~ ERROR `break` with value from a `while` loop
9 | ^^^^^
10
11 error[E0571]: `break` with value from a `while` loop
12 --> $DIR/loop-break-value.rs:30:13
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
17 |
18 LL | break;
19 | ^^^^^
20
21 error[E0571]: `break` with value from a `while let` loop
22 --> $DIR/loop-break-value.rs:38:12
23 |
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
27 |
28 LL | if break { //~ ERROR `break` with value from a `while let` loop
29 | ^^^^^
30
31 error[E0571]: `break` with value from a `while let` loop
32 --> $DIR/loop-break-value.rs:43:9
33 |
34 LL | break None;
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
37 |
38 LL | break;
39 | ^^^^^
40
41 error[E0571]: `break` with value from a `while let` loop
42 --> $DIR/loop-break-value.rs:49:13
43 |
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
47 |
48 LL | break;
49 | ^^^^^
50
51 error[E0571]: `break` with value from a `for` loop
52 --> $DIR/loop-break-value.rs:56:9
53 |
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
57 |
58 LL | break; //~ ERROR `break` with value from a `for` loop
59 | ^^^^^
60
61 error[E0571]: `break` with value from a `for` loop
62 --> $DIR/loop-break-value.rs:57:9
63 |
64 LL | break [()];
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
67 |
68 LL | break;
69 | ^^^^^
70
71 error[E0571]: `break` with value from a `for` loop
72 --> $DIR/loop-break-value.rs:64:13
73 |
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
77 |
78 LL | break;
79 | ^^^^^
80
81 error[E0308]: mismatched types
82 --> $DIR/loop-break-value.rs:4:31
83 |
84 LL | let val: ! = loop { break break; };
85 | ^^^^^ expected (), found !
86 |
87 = note: expected type `()`
88 found type `!`
89
90 error[E0308]: mismatched types
91 --> $DIR/loop-break-value.rs:11:19
92 |
93 LL | break 123; //~ ERROR mismatched types
94 | ^^^ expected &str, found integer
95 |
96 = note: expected type `&str`
97 found type `{integer}`
98
99 error[E0308]: mismatched types
100 --> $DIR/loop-break-value.rs:16:15
101 |
102 LL | break "asdf"; //~ ERROR mismatched types
103 | ^^^^^^ expected i32, found reference
104 |
105 = note: expected type `i32`
106 found type `&'static str`
107
108 error[E0308]: mismatched types
109 --> $DIR/loop-break-value.rs:21:31
110 |
111 LL | break 'outer_loop "nope"; //~ ERROR mismatched types
112 | ^^^^^^ expected i32, found reference
113 |
114 = note: expected type `i32`
115 found type `&'static str`
116
117 error[E0308]: mismatched types
118 --> $DIR/loop-break-value.rs:73:26
119 |
120 LL | break 'c 123; //~ ERROR mismatched types
121 | ^^^ expected (), found integer
122 |
123 = note: expected type `()`
124 found type `{integer}`
125
126 error[E0308]: mismatched types
127 --> $DIR/loop-break-value.rs:80:15
128 |
129 LL | break (break, break); //~ ERROR mismatched types
130 | ^^^^^^^^^^^^^^ expected (), found tuple
131 |
132 = note: expected type `()`
133 found type `(!, !)`
134
135 error[E0308]: mismatched types
136 --> $DIR/loop-break-value.rs:85:15
137 |
138 LL | break 2; //~ ERROR mismatched types
139 | ^ expected (), found integer
140 |
141 = note: expected type `()`
142 found type `{integer}`
143
144 error[E0308]: mismatched types
145 --> $DIR/loop-break-value.rs:90:9
146 |
147 LL | break; //~ ERROR mismatched types
148 | ^^^^^ expected (), found integer
149 |
150 = note: expected type `()`
151 found type `{integer}`
152
153 error: aborting due to 16 previous errors
154
155 Some errors occurred: E0308, E0571.
156 For more information about an error, try `rustc --explain E0308`.