Skip to content

Commit e6be02e

Browse files
committed
Rustup: fix 32bit tests
1 parent 934471c commit e6be02e

File tree

2 files changed

+72
-48
lines changed

2 files changed

+72
-48
lines changed

tests/ui/cast_size.32bit.stderr

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ LL | 1isize as i8;
99
= help: to override `-D warnings` add `#[allow(clippy::cast_possible_truncation)]`
1010
help: ... or use `try_from` and handle the error accordingly
1111
|
12-
LL | i8::try_from(1isize);
13-
| ~~~~~~~~~~~~~~~~~~~~
12+
LL - 1isize as i8;
13+
LL + i8::try_from(1isize);
14+
|
1415

1516
error: casting `isize` to `f32` causes a loss of precision (`isize` is 32 or 64 bits wide, but `f32`'s mantissa is only 23 bits wide)
1617
--> tests/ui/cast_size.rs:24:5
@@ -48,8 +49,9 @@ LL | 1isize as i32;
4849
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
4950
help: ... or use `try_from` and handle the error accordingly
5051
|
51-
LL | i32::try_from(1isize);
52-
| ~~~~~~~~~~~~~~~~~~~~~
52+
LL - 1isize as i32;
53+
LL + i32::try_from(1isize);
54+
|
5355

5456
error: casting `isize` to `u32` may truncate the value on targets with 64-bit wide pointers
5557
--> tests/ui/cast_size.rs:37:5
@@ -60,8 +62,9 @@ LL | 1isize as u32;
6062
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
6163
help: ... or use `try_from` and handle the error accordingly
6264
|
63-
LL | u32::try_from(1isize);
64-
| ~~~~~~~~~~~~~~~~~~~~~
65+
LL - 1isize as u32;
66+
LL + u32::try_from(1isize);
67+
|
6568

6669
error: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
6770
--> tests/ui/cast_size.rs:39:5
@@ -72,8 +75,9 @@ LL | 1usize as u32;
7275
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
7376
help: ... or use `try_from` and handle the error accordingly
7477
|
75-
LL | u32::try_from(1usize);
76-
| ~~~~~~~~~~~~~~~~~~~~~
78+
LL - 1usize as u32;
79+
LL + u32::try_from(1usize);
80+
|
7781

7882
error: casting `usize` to `i32` may truncate the value on targets with 64-bit wide pointers
7983
--> tests/ui/cast_size.rs:41:5
@@ -84,8 +88,9 @@ LL | 1usize as i32;
8488
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
8589
help: ... or use `try_from` and handle the error accordingly
8690
|
87-
LL | i32::try_from(1usize);
88-
| ~~~~~~~~~~~~~~~~~~~~~
91+
LL - 1usize as i32;
92+
LL + i32::try_from(1usize);
93+
|
8994

9095
error: casting `usize` to `i32` may wrap around the value on targets with 32-bit wide pointers
9196
--> tests/ui/cast_size.rs:41:5
@@ -105,8 +110,9 @@ LL | 1i64 as isize;
105110
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
106111
help: ... or use `try_from` and handle the error accordingly
107112
|
108-
LL | isize::try_from(1i64);
109-
| ~~~~~~~~~~~~~~~~~~~~~
113+
LL - 1i64 as isize;
114+
LL + isize::try_from(1i64);
115+
|
110116

111117
error: casting `i64` to `usize` may truncate the value on targets with 32-bit wide pointers
112118
--> tests/ui/cast_size.rs:46:5
@@ -117,8 +123,9 @@ LL | 1i64 as usize;
117123
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
118124
help: ... or use `try_from` and handle the error accordingly
119125
|
120-
LL | usize::try_from(1i64);
121-
| ~~~~~~~~~~~~~~~~~~~~~
126+
LL - 1i64 as usize;
127+
LL + usize::try_from(1i64);
128+
|
122129

123130
error: casting `u64` to `isize` may truncate the value on targets with 32-bit wide pointers
124131
--> tests/ui/cast_size.rs:48:5
@@ -129,8 +136,9 @@ LL | 1u64 as isize;
129136
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
130137
help: ... or use `try_from` and handle the error accordingly
131138
|
132-
LL | isize::try_from(1u64);
133-
| ~~~~~~~~~~~~~~~~~~~~~
139+
LL - 1u64 as isize;
140+
LL + isize::try_from(1u64);
141+
|
134142

135143
error: casting `u64` to `isize` may wrap around the value on targets with 64-bit wide pointers
136144
--> tests/ui/cast_size.rs:48:5
@@ -147,8 +155,9 @@ LL | 1u64 as usize;
147155
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
148156
help: ... or use `try_from` and handle the error accordingly
149157
|
150-
LL | usize::try_from(1u64);
151-
| ~~~~~~~~~~~~~~~~~~~~~
158+
LL - 1u64 as usize;
159+
LL + usize::try_from(1u64);
160+
|
152161

153162
error: casting `u32` to `isize` may wrap around the value on targets with 32-bit wide pointers
154163
--> tests/ui/cast_size.rs:53:5

tests/ui/large_enum_variant.32bit.stderr

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ LL | | }
1414
= help: to override `-D warnings` add `#[allow(clippy::large_enum_variant)]`
1515
help: consider boxing the large fields to reduce the total size of the enum
1616
|
17-
LL | B(Box<[i32; 8000]>),
18-
| ~~~~~~~~~~~~~~~~
17+
LL - B([i32; 8000]),
18+
LL + B(Box<[i32; 8000]>),
19+
|
1920

2021
error: large size difference between variants
2122
--> tests/ui/large_enum_variant.rs:38:1
@@ -31,8 +32,9 @@ LL | | }
3132
|
3233
help: consider boxing the large fields to reduce the total size of the enum
3334
|
34-
LL | ContainingLargeEnum(Box<LargeEnum>),
35-
| ~~~~~~~~~~~~~~
35+
LL - ContainingLargeEnum(LargeEnum),
36+
LL + ContainingLargeEnum(Box<LargeEnum>),
37+
|
3638

3739
error: large size difference between variants
3840
--> tests/ui/large_enum_variant.rs:44:1
@@ -49,8 +51,9 @@ LL | | }
4951
|
5052
help: consider boxing the large fields to reduce the total size of the enum
5153
|
52-
LL | ContainingMoreThanOneField(i32, Box<[i32; 8000]>, Box<[i32; 9500]>),
53-
| ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
54+
LL - ContainingMoreThanOneField(i32, [i32; 8000], [i32; 9500]),
55+
LL + ContainingMoreThanOneField(i32, Box<[i32; 8000]>, Box<[i32; 9500]>),
56+
|
5457

5558
error: large size difference between variants
5659
--> tests/ui/large_enum_variant.rs:51:1
@@ -66,8 +69,9 @@ LL | | }
6669
|
6770
help: consider boxing the large fields to reduce the total size of the enum
6871
|
69-
LL | StructLikeLarge { x: Box<[i32; 8000]>, y: i32 },
70-
| ~~~~~~~~~~~~~~~~
72+
LL - StructLikeLarge { x: [i32; 8000], y: i32 },
73+
LL + StructLikeLarge { x: Box<[i32; 8000]>, y: i32 },
74+
|
7175

7276
error: large size difference between variants
7377
--> tests/ui/large_enum_variant.rs:57:1
@@ -83,8 +87,9 @@ LL | | }
8387
|
8488
help: consider boxing the large fields to reduce the total size of the enum
8589
|
86-
LL | StructLikeLarge2 { x: Box<[i32; 8000]> },
87-
| ~~~~~~~~~~~~~~~~
90+
LL - StructLikeLarge2 { x: [i32; 8000] },
91+
LL + StructLikeLarge2 { x: Box<[i32; 8000]> },
92+
|
8893

8994
error: large size difference between variants
9095
--> tests/ui/large_enum_variant.rs:74:1
@@ -101,8 +106,9 @@ LL | | }
101106
|
102107
help: consider boxing the large fields to reduce the total size of the enum
103108
|
104-
LL | B(Box<[u8; 1255]>),
105-
| ~~~~~~~~~~~~~~~
109+
LL - B([u8; 1255]),
110+
LL + B(Box<[u8; 1255]>),
111+
|
106112

107113
error: large size difference between variants
108114
--> tests/ui/large_enum_variant.rs:81:1
@@ -118,8 +124,9 @@ LL | | }
118124
|
119125
help: consider boxing the large fields to reduce the total size of the enum
120126
|
121-
LL | ContainingMoreThanOneField(Box<[i32; 8000]>, [i32; 2], Box<[i32; 9500]>, [i32; 30]),
122-
| ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
127+
LL - ContainingMoreThanOneField([i32; 8000], [i32; 2], [i32; 9500], [i32; 30]),
128+
LL + ContainingMoreThanOneField(Box<[i32; 8000]>, [i32; 2], Box<[i32; 9500]>, [i32; 30]),
129+
|
123130

124131
error: large size difference between variants
125132
--> tests/ui/large_enum_variant.rs:87:1
@@ -135,8 +142,9 @@ LL | | }
135142
|
136143
help: consider boxing the large fields to reduce the total size of the enum
137144
|
138-
LL | B(Box<Struct2>),
139-
| ~~~~~~~~~~~~
145+
LL - B(Struct2),
146+
LL + B(Box<Struct2>),
147+
|
140148

141149
error: large size difference between variants
142150
--> tests/ui/large_enum_variant.rs:93:1
@@ -152,8 +160,9 @@ LL | | }
152160
|
153161
help: consider boxing the large fields to reduce the total size of the enum
154162
|
155-
LL | B(Box<Struct2>),
156-
| ~~~~~~~~~~~~
163+
LL - B(Struct2),
164+
LL + B(Box<Struct2>),
165+
|
157166

158167
error: large size difference between variants
159168
--> tests/ui/large_enum_variant.rs:99:1
@@ -169,8 +178,9 @@ LL | | }
169178
|
170179
help: consider boxing the large fields to reduce the total size of the enum
171180
|
172-
LL | B(Box<Struct2>),
173-
| ~~~~~~~~~~~~
181+
LL - B(Struct2),
182+
LL + B(Box<Struct2>),
183+
|
174184

175185
error: large size difference between variants
176186
--> tests/ui/large_enum_variant.rs:115:1
@@ -255,8 +265,9 @@ LL | | }
255265
|
256266
help: consider boxing the large fields to reduce the total size of the enum
257267
|
258-
LL | Large(Box<(T, [u8; 512])>),
259-
| ~~~~~~~~~~~~~~~~~~~
268+
LL - Large((T, [u8; 512])),
269+
LL + Large(Box<(T, [u8; 512])>),
270+
|
260271

261272
error: large size difference between variants
262273
--> tests/ui/large_enum_variant.rs:159:1
@@ -272,8 +283,9 @@ LL | | }
272283
|
273284
help: consider boxing the large fields to reduce the total size of the enum
274285
|
275-
LL | Large(Box<[Foo<u64>; 64]>),
276-
| ~~~~~~~~~~~~~~~~~~~
286+
LL - Large([Foo<u64>; 64]),
287+
LL + Large(Box<[Foo<u64>; 64]>),
288+
|
277289

278290
error: large size difference between variants
279291
--> tests/ui/large_enum_variant.rs:170:1
@@ -289,8 +301,9 @@ LL | | }
289301
|
290302
help: consider boxing the large fields to reduce the total size of the enum
291303
|
292-
LL | Error(Box<PossiblyLargeEnumWithConst<256>>),
293-
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
304+
LL - Error(PossiblyLargeEnumWithConst<256>),
305+
LL + Error(Box<PossiblyLargeEnumWithConst<256>>),
306+
|
294307

295308
error: large size difference between variants
296309
--> tests/ui/large_enum_variant.rs:176:1
@@ -306,8 +319,9 @@ LL | | }
306319
|
307320
help: consider boxing the large fields to reduce the total size of the enum
308321
|
309-
LL | Large(Box<[u64; 64]>),
310-
| ~~~~~~~~~~~~~~
322+
LL - Large([u64; 64]),
323+
LL + Large(Box<[u64; 64]>),
324+
|
311325

312326
error: large size difference between variants
313327
--> tests/ui/large_enum_variant.rs:187:1
@@ -323,8 +337,9 @@ LL | | }
323337
|
324338
help: consider boxing the large fields to reduce the total size of the enum
325339
|
326-
LL | Error(Box<WithRecursionAndGenerics<u64>>),
327-
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
340+
LL - Error(WithRecursionAndGenerics<u64>),
341+
LL + Error(Box<WithRecursionAndGenerics<u64>>),
342+
|
328343

329344
error: aborting due to 18 previous errors
330345

0 commit comments

Comments
 (0)