Skip to content

Commit 2113769

Browse files
committed
Update ui test
1 parent 6033895 commit 2113769

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

tests/ui/lint/type-overflow.stderr

+26-2
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,33 @@ warning: literal out of range for `i8`
1616
--> $DIR/type-overflow.rs:10:16
1717
|
1818
LL | let fail = 0b1000_0001i8;
19-
| ^^^^^^^^^^^^^ help: consider using the type `u8` instead: `0b1000_0001u8`
19+
| ^^^^^^^^^^^^^
2020
|
2121
= note: the literal `0b1000_0001i8` (decimal `129`) does not fit into the type `i8` and will become `-127i8`
22+
help: consider using the type `u8` instead
23+
|
24+
LL | let fail = 0b1000_0001u8;
25+
| ~~~~~~~~~~~~~
26+
help: to use as a negative number (decimal `-127`), consider using the type `u8` for the literal and cast it to `i8`
27+
|
28+
LL | let fail = 0b1000_0001u8 as i8;
29+
| ~~~~~~~~~~~~~~~~~~~
2230

2331
warning: literal out of range for `i64`
2432
--> $DIR/type-overflow.rs:12:16
2533
|
2634
LL | let fail = 0x8000_0000_0000_0000i64;
27-
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the type `u64` instead: `0x8000_0000_0000_0000u64`
35+
| ^^^^^^^^^^^^^^^^^^^^^^^^
2836
|
2937
= note: the literal `0x8000_0000_0000_0000i64` (decimal `9223372036854775808`) does not fit into the type `i64` and will become `-9223372036854775808i64`
38+
help: consider using the type `u64` instead
39+
|
40+
LL | let fail = 0x8000_0000_0000_0000u64;
41+
| ~~~~~~~~~~~~~~~~~~~~~~~~
42+
help: to use as a negative number (decimal `-9223372036854775808`), consider using the type `u64` for the literal and cast it to `i64`
43+
|
44+
LL | let fail = 0x8000_0000_0000_0000u64 as i64;
45+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3046

3147
warning: literal out of range for `u32`
3248
--> $DIR/type-overflow.rs:14:16
@@ -44,6 +60,10 @@ LL | let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000;
4460
|
4561
= note: the literal `0x8000_0000_0000_0000_0000_0000_0000_0000` (decimal `170141183460469231731687303715884105728`) does not fit into the type `i128` and will become `-170141183460469231731687303715884105728i128`
4662
= help: consider using the type `u128` instead
63+
help: to use as a negative number (decimal `-170141183460469231731687303715884105728`), consider using the type `u128` for the literal and cast it to `i128`
64+
|
65+
LL | let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000u128 as i128;
66+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4767

4868
warning: literal out of range for `i32`
4969
--> $DIR/type-overflow.rs:19:16
@@ -53,6 +73,10 @@ LL | let fail = 0x8FFF_FFFF_FFFF_FFFE;
5373
|
5474
= note: the literal `0x8FFF_FFFF_FFFF_FFFE` (decimal `10376293541461622782`) does not fit into the type `i32` and will become `-2i32`
5575
= help: consider using the type `i128` instead
76+
help: to use as a negative number (decimal `-2`), consider using the type `u32` for the literal and cast it to `i32`
77+
|
78+
LL | let fail = 0x8FFF_FFFF_FFFF_FFFEu32 as i32;
79+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5680

5781
warning: literal out of range for `i8`
5882
--> $DIR/type-overflow.rs:21:17

0 commit comments

Comments
 (0)