You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/ui/lint/type-overflow.stderr
+16-3
Original file line number
Diff line number
Diff line change
@@ -110,9 +110,9 @@ LL | let fail = 0x8FFF_FFFF_FFFF_FFFE;
110
110
|
111
111
= note: the literal `0x8FFF_FFFF_FFFF_FFFE` (decimal `10376293541461622782`) does not fit into the type `i32` and will become `-2i32`
112
112
= help: consider using the type `u64` instead
113
-
help: to use as a negative number (decimal `-2`), consider using the type `u32` for the literal and cast it to `i32`
113
+
help: to use as a negative number (decimal `-2`), consider using the type `u64` for the literal and cast it to `i32`
114
114
|
115
-
LL | let fail = 0x8FFF_FFFF_FFFF_FFFEu32 as i32;
115
+
LL | let fail = 0x8FFF_FFFF_FFFF_FFFEu64 as i32;
116
116
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117
117
118
118
warning: literal out of range for `i8`
@@ -124,5 +124,18 @@ LL | let fail = -0b1111_1111i8;
124
124
= note: the literal `0b1111_1111i8` (decimal `255`) does not fit into the type `i8`
125
125
= note: and the value `-0b1111_1111i8` will become `1i8`
126
126
127
-
warning: 11 warnings emitted
127
+
warning: literal out of range for `i32`
128
+
--> $DIR/type-overflow.rs:49:16
129
+
|
130
+
LL | let fail = 0x8000_0000_0000_0000_0000_0000_FFFF_FFFE;
131
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
132
+
|
133
+
= note: the literal `0x8000_0000_0000_0000_0000_0000_FFFF_FFFE` (decimal `170141183460469231731687303720179073022`) does not fit into the type `i32` and will become `-2i32`
134
+
= help: consider using the type `u128` instead
135
+
help: to use as a negative number (decimal `-2`), consider using the type `u128` for the literal and cast it to `i32`
136
+
|
137
+
LL | let fail = 0x8000_0000_0000_0000_0000_0000_FFFF_FFFEu128 as i32;
0 commit comments