summary refs log tree commit diff
path: root/src/test/ui/loops/loop-break-value.stderr
blob: 3e009c007e08da037f736e3f2cfb34b6d0a8d6a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
error[E0571]: `break` with value from a `while` loop
  --> $DIR/loop-break-value.rs:28:9
   |
LL |         break (); //~ ERROR `break` with value from a `while` loop
   |         ^^^^^^^^ 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 `break` with value from a `while` loop
   |         ^^^^^

error[E0571]: `break` with value from a `while` loop
  --> $DIR/loop-break-value.rs:30:13
   |
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
  --> $DIR/loop-break-value.rs:38:12
   |
LL |         if break () { //~ ERROR `break` with value from a `while let` loop
   |            ^^^^^^^^ 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 |         if break { //~ ERROR `break` with value from a `while let` loop
   |            ^^^^^

error[E0571]: `break` with value from a `while let` loop
  --> $DIR/loop-break-value.rs:43:9
   |
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
  --> $DIR/loop-break-value.rs:49:13
   |
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
  --> $DIR/loop-break-value.rs:56:9
   |
LL |         break (); //~ ERROR `break` with value from a `for` loop
   |         ^^^^^^^^ 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 `break` with value from a `for` loop
   |         ^^^^^

error[E0571]: `break` with value from a `for` loop
  --> $DIR/loop-break-value.rs:57:9
   |
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
  --> $DIR/loop-break-value.rs:64:13
   |
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
  --> $DIR/loop-break-value.rs:4:31
   |
LL |     let val: ! = loop { break break; };
   |                               ^^^^^ expected (), found !
   |
   = note: expected type `()`
              found type `!`

error[E0308]: mismatched types
  --> $DIR/loop-break-value.rs:11:19
   |
LL |             break 123; //~ ERROR mismatched types
   |                   ^^^ expected &str, found integer
   |
   = note: expected type `&str`
              found type `{integer}`

error[E0308]: mismatched types
  --> $DIR/loop-break-value.rs:16:15
   |
LL |         break "asdf"; //~ ERROR mismatched types
   |               ^^^^^^ expected i32, found reference
   |
   = note: expected type `i32`
              found type `&'static str`

error[E0308]: mismatched types
  --> $DIR/loop-break-value.rs:21:31
   |
LL |             break 'outer_loop "nope"; //~ ERROR mismatched types
   |                               ^^^^^^ expected i32, found reference
   |
   = note: expected type `i32`
              found type `&'static str`

error[E0308]: mismatched types
  --> $DIR/loop-break-value.rs:73:26
   |
LL |                 break 'c 123; //~ ERROR mismatched types
   |                          ^^^ expected (), found integer
   |
   = note: expected type `()`
              found type `{integer}`

error[E0308]: mismatched types
  --> $DIR/loop-break-value.rs:80:15
   |
LL |         break (break, break); //~ ERROR mismatched types
   |               ^^^^^^^^^^^^^^ expected (), found tuple
   |
   = note: expected type `()`
              found type `(!, !)`

error[E0308]: mismatched types
  --> $DIR/loop-break-value.rs:85:15
   |
LL |         break 2; //~ ERROR mismatched types
   |               ^ expected (), found integer
   |
   = note: expected type `()`
              found type `{integer}`

error[E0308]: mismatched types
  --> $DIR/loop-break-value.rs:90:9
   |
LL |         break; //~ ERROR mismatched types
   |         ^^^^^ expected (), found integer
   |
   = note: expected type `()`
              found type `{integer}`

error: aborting due to 16 previous errors

Some errors occurred: E0308, E0571.
For more information about an error, try `rustc --explain E0308`.