Skip to content

Commit 41deb83

Browse files
committed
Add compile flag
1 parent a937d8c commit 41deb83

File tree

2 files changed

+43
-41
lines changed

2 files changed

+43
-41
lines changed

src/test/ui/issues/issue-8460-const.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// compile-flags: -O
2+
13
#![deny(const_err)]
24

35
use std::{isize, i8, i16, i32, i64};

src/test/ui/issues/issue-8460-const.stderr

+41-41
Original file line numberDiff line numberDiff line change
@@ -1,245 +1,245 @@
11
error: attempt to divide with overflow
2-
--> $DIR/issue-8460-const.rs:7:36
2+
--> $DIR/issue-8460-const.rs:9:36
33
|
44
LL | assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
55
| ^^^^^^^^^^^^^^^
66
|
77
note: lint level defined here
8-
--> $DIR/issue-8460-const.rs:1:9
8+
--> $DIR/issue-8460-const.rs:3:9
99
|
1010
LL | #![deny(const_err)]
1111
| ^^^^^^^^^
1212

1313
error: this expression will panic at runtime
14-
--> $DIR/issue-8460-const.rs:7:36
14+
--> $DIR/issue-8460-const.rs:9:36
1515
|
1616
LL | assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
1717
| ^^^^^^^^^^^^^^^ attempt to divide with overflow
1818

1919
error: attempt to divide with overflow
20-
--> $DIR/issue-8460-const.rs:10:36
20+
--> $DIR/issue-8460-const.rs:12:36
2121
|
2222
LL | assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err());
2323
| ^^^^^^^^^^^^
2424

2525
error: this expression will panic at runtime
26-
--> $DIR/issue-8460-const.rs:10:36
26+
--> $DIR/issue-8460-const.rs:12:36
2727
|
2828
LL | assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err());
2929
| ^^^^^^^^^^^^ attempt to divide with overflow
3030

3131
error: attempt to divide with overflow
32-
--> $DIR/issue-8460-const.rs:13:36
32+
--> $DIR/issue-8460-const.rs:15:36
3333
|
3434
LL | assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err());
3535
| ^^^^^^^^^^^^^
3636

3737
error: this expression will panic at runtime
38-
--> $DIR/issue-8460-const.rs:13:36
38+
--> $DIR/issue-8460-const.rs:15:36
3939
|
4040
LL | assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err());
4141
| ^^^^^^^^^^^^^ attempt to divide with overflow
4242

4343
error: attempt to divide with overflow
44-
--> $DIR/issue-8460-const.rs:16:36
44+
--> $DIR/issue-8460-const.rs:18:36
4545
|
4646
LL | assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err());
4747
| ^^^^^^^^^^^^^
4848

4949
error: this expression will panic at runtime
50-
--> $DIR/issue-8460-const.rs:16:36
50+
--> $DIR/issue-8460-const.rs:18:36
5151
|
5252
LL | assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err());
5353
| ^^^^^^^^^^^^^ attempt to divide with overflow
5454

5555
error: attempt to divide with overflow
56-
--> $DIR/issue-8460-const.rs:19:36
56+
--> $DIR/issue-8460-const.rs:21:36
5757
|
5858
LL | assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err());
5959
| ^^^^^^^^^^^^^
6060

6161
error: this expression will panic at runtime
62-
--> $DIR/issue-8460-const.rs:19:36
62+
--> $DIR/issue-8460-const.rs:21:36
6363
|
6464
LL | assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err());
6565
| ^^^^^^^^^^^^^ attempt to divide with overflow
6666

6767
error: attempt to divide by zero
68-
--> $DIR/issue-8460-const.rs:22:36
68+
--> $DIR/issue-8460-const.rs:24:36
6969
|
7070
LL | assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err());
7171
| ^^^^^^^^^^
7272

7373
error: this expression will panic at runtime
74-
--> $DIR/issue-8460-const.rs:22:36
74+
--> $DIR/issue-8460-const.rs:24:36
7575
|
7676
LL | assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err());
7777
| ^^^^^^^^^^ attempt to divide by zero
7878

7979
error: attempt to divide by zero
80-
--> $DIR/issue-8460-const.rs:25:36
80+
--> $DIR/issue-8460-const.rs:27:36
8181
|
8282
LL | assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err());
8383
| ^^^^^^^
8484

8585
error: this expression will panic at runtime
86-
--> $DIR/issue-8460-const.rs:25:36
86+
--> $DIR/issue-8460-const.rs:27:36
8787
|
8888
LL | assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err());
8989
| ^^^^^^^ attempt to divide by zero
9090

9191
error: attempt to divide by zero
92-
--> $DIR/issue-8460-const.rs:28:36
92+
--> $DIR/issue-8460-const.rs:30:36
9393
|
9494
LL | assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err());
9595
| ^^^^^^^^
9696

9797
error: this expression will panic at runtime
98-
--> $DIR/issue-8460-const.rs:28:36
98+
--> $DIR/issue-8460-const.rs:30:36
9999
|
100100
LL | assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err());
101101
| ^^^^^^^^ attempt to divide by zero
102102

103103
error: attempt to divide by zero
104-
--> $DIR/issue-8460-const.rs:31:36
104+
--> $DIR/issue-8460-const.rs:33:36
105105
|
106106
LL | assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err());
107107
| ^^^^^^^^
108108

109109
error: this expression will panic at runtime
110-
--> $DIR/issue-8460-const.rs:31:36
110+
--> $DIR/issue-8460-const.rs:33:36
111111
|
112112
LL | assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err());
113113
| ^^^^^^^^ attempt to divide by zero
114114

115115
error: attempt to divide by zero
116-
--> $DIR/issue-8460-const.rs:34:36
116+
--> $DIR/issue-8460-const.rs:36:36
117117
|
118118
LL | assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err());
119119
| ^^^^^^^^
120120

121121
error: this expression will panic at runtime
122-
--> $DIR/issue-8460-const.rs:34:36
122+
--> $DIR/issue-8460-const.rs:36:36
123123
|
124124
LL | assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err());
125125
| ^^^^^^^^ attempt to divide by zero
126126

127127
error: attempt to calculate the remainder with overflow
128-
--> $DIR/issue-8460-const.rs:37:36
128+
--> $DIR/issue-8460-const.rs:39:36
129129
|
130130
LL | assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err());
131131
| ^^^^^^^^^^^^^^^
132132

133133
error: this expression will panic at runtime
134-
--> $DIR/issue-8460-const.rs:37:36
134+
--> $DIR/issue-8460-const.rs:39:36
135135
|
136136
LL | assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err());
137137
| ^^^^^^^^^^^^^^^ attempt to calculate the remainder with overflow
138138

139139
error: attempt to calculate the remainder with overflow
140-
--> $DIR/issue-8460-const.rs:40:36
140+
--> $DIR/issue-8460-const.rs:42:36
141141
|
142142
LL | assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err());
143143
| ^^^^^^^^^^^^
144144

145145
error: this expression will panic at runtime
146-
--> $DIR/issue-8460-const.rs:40:36
146+
--> $DIR/issue-8460-const.rs:42:36
147147
|
148148
LL | assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err());
149149
| ^^^^^^^^^^^^ attempt to calculate the remainder with overflow
150150

151151
error: attempt to calculate the remainder with overflow
152-
--> $DIR/issue-8460-const.rs:43:36
152+
--> $DIR/issue-8460-const.rs:45:36
153153
|
154154
LL | assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err());
155155
| ^^^^^^^^^^^^^
156156

157157
error: this expression will panic at runtime
158-
--> $DIR/issue-8460-const.rs:43:36
158+
--> $DIR/issue-8460-const.rs:45:36
159159
|
160160
LL | assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err());
161161
| ^^^^^^^^^^^^^ attempt to calculate the remainder with overflow
162162

163163
error: attempt to calculate the remainder with overflow
164-
--> $DIR/issue-8460-const.rs:46:36
164+
--> $DIR/issue-8460-const.rs:48:36
165165
|
166166
LL | assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err());
167167
| ^^^^^^^^^^^^^
168168

169169
error: this expression will panic at runtime
170-
--> $DIR/issue-8460-const.rs:46:36
170+
--> $DIR/issue-8460-const.rs:48:36
171171
|
172172
LL | assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err());
173173
| ^^^^^^^^^^^^^ attempt to calculate the remainder with overflow
174174

175175
error: attempt to calculate the remainder with overflow
176-
--> $DIR/issue-8460-const.rs:49:36
176+
--> $DIR/issue-8460-const.rs:51:36
177177
|
178178
LL | assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err());
179179
| ^^^^^^^^^^^^^
180180

181181
error: this expression will panic at runtime
182-
--> $DIR/issue-8460-const.rs:49:36
182+
--> $DIR/issue-8460-const.rs:51:36
183183
|
184184
LL | assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err());
185185
| ^^^^^^^^^^^^^ attempt to calculate the remainder with overflow
186186

187187
error: attempt to calculate the remainder with a divisor of zero
188-
--> $DIR/issue-8460-const.rs:52:36
188+
--> $DIR/issue-8460-const.rs:54:36
189189
|
190190
LL | assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err());
191191
| ^^^^^^^^^^
192192

193193
error: this expression will panic at runtime
194-
--> $DIR/issue-8460-const.rs:52:36
194+
--> $DIR/issue-8460-const.rs:54:36
195195
|
196196
LL | assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err());
197197
| ^^^^^^^^^^ attempt to calculate the remainder with a divisor of zero
198198

199199
error: attempt to calculate the remainder with a divisor of zero
200-
--> $DIR/issue-8460-const.rs:55:36
200+
--> $DIR/issue-8460-const.rs:57:36
201201
|
202202
LL | assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err());
203203
| ^^^^^^^
204204

205205
error: this expression will panic at runtime
206-
--> $DIR/issue-8460-const.rs:55:36
206+
--> $DIR/issue-8460-const.rs:57:36
207207
|
208208
LL | assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err());
209209
| ^^^^^^^ attempt to calculate the remainder with a divisor of zero
210210

211211
error: attempt to calculate the remainder with a divisor of zero
212-
--> $DIR/issue-8460-const.rs:58:36
212+
--> $DIR/issue-8460-const.rs:60:36
213213
|
214214
LL | assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err());
215215
| ^^^^^^^^
216216

217217
error: this expression will panic at runtime
218-
--> $DIR/issue-8460-const.rs:58:36
218+
--> $DIR/issue-8460-const.rs:60:36
219219
|
220220
LL | assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err());
221221
| ^^^^^^^^ attempt to calculate the remainder with a divisor of zero
222222

223223
error: attempt to calculate the remainder with a divisor of zero
224-
--> $DIR/issue-8460-const.rs:61:36
224+
--> $DIR/issue-8460-const.rs:63:36
225225
|
226226
LL | assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err());
227227
| ^^^^^^^^
228228

229229
error: this expression will panic at runtime
230-
--> $DIR/issue-8460-const.rs:61:36
230+
--> $DIR/issue-8460-const.rs:63:36
231231
|
232232
LL | assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err());
233233
| ^^^^^^^^ attempt to calculate the remainder with a divisor of zero
234234

235235
error: attempt to calculate the remainder with a divisor of zero
236-
--> $DIR/issue-8460-const.rs:64:36
236+
--> $DIR/issue-8460-const.rs:66:36
237237
|
238238
LL | assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err());
239239
| ^^^^^^^^
240240

241241
error: this expression will panic at runtime
242-
--> $DIR/issue-8460-const.rs:64:36
242+
--> $DIR/issue-8460-const.rs:66:36
243243
|
244244
LL | assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err());
245245
| ^^^^^^^^ attempt to calculate the remainder with a divisor of zero

0 commit comments

Comments
 (0)