@@ -26,6 +26,7 @@ LL | let x1: i8 = 128;
26
26
| ^^^
27
27
|
28
28
= note: the literal `128` does not fit into the type `i8` whose range is `-128..=127`
29
+ = help: consider using `u8` instead
29
30
30
31
error: literal out of range for `i8`
31
32
--> $DIR/lint-type-overflow.rs:18:19
@@ -34,6 +35,7 @@ LL | let x3: i8 = -129;
34
35
| ^^^
35
36
|
36
37
= note: the literal `129` does not fit into the type `i8` whose range is `-128..=127`
38
+ = help: consider using `i16` instead
37
39
38
40
error: literal out of range for `i8`
39
41
--> $DIR/lint-type-overflow.rs:19:19
@@ -42,6 +44,7 @@ LL | let x3: i8 = -(129);
42
44
| ^^^^^
43
45
|
44
46
= note: the literal `129` does not fit into the type `i8` whose range is `-128..=127`
47
+ = help: consider using `i16` instead
45
48
46
49
error: literal out of range for `i8`
47
50
--> $DIR/lint-type-overflow.rs:20:20
@@ -50,6 +53,7 @@ LL | let x3: i8 = -{129};
50
53
| ^^^
51
54
|
52
55
= note: the literal `129` does not fit into the type `i8` whose range is `-128..=127`
56
+ = help: consider using `u8` instead
53
57
54
58
error: literal out of range for `i8`
55
59
--> $DIR/lint-type-overflow.rs:22:10
@@ -58,6 +62,7 @@ LL | test(1000);
58
62
| ^^^^
59
63
|
60
64
= note: the literal `1000` does not fit into the type `i8` whose range is `-128..=127`
65
+ = help: consider using `i16` instead
61
66
62
67
error: literal out of range for `i8`
63
68
--> $DIR/lint-type-overflow.rs:24:13
@@ -66,6 +71,7 @@ LL | let x = 128_i8;
66
71
| ^^^^^^
67
72
|
68
73
= note: the literal `128_i8` does not fit into the type `i8` whose range is `-128..=127`
74
+ = help: consider using `u8` instead
69
75
70
76
error: literal out of range for `i8`
71
77
--> $DIR/lint-type-overflow.rs:28:14
@@ -74,6 +80,7 @@ LL | let x = -129_i8;
74
80
| ^^^^^^
75
81
|
76
82
= note: the literal `129_i8` does not fit into the type `i8` whose range is `-128..=127`
83
+ = help: consider using `i16` instead
77
84
78
85
error: literal out of range for `i32`
79
86
--> $DIR/lint-type-overflow.rs:32:18
@@ -82,6 +89,7 @@ LL | let x: i32 = 2147483648;
82
89
| ^^^^^^^^^^
83
90
|
84
91
= note: the literal `2147483648` does not fit into the type `i32` whose range is `-2147483648..=2147483647`
92
+ = help: consider using `u32` instead
85
93
86
94
error: literal out of range for `i32`
87
95
--> $DIR/lint-type-overflow.rs:33:13
@@ -90,6 +98,7 @@ LL | let x = 2147483648_i32;
90
98
| ^^^^^^^^^^^^^^
91
99
|
92
100
= note: the literal `2147483648_i32` does not fit into the type `i32` whose range is `-2147483648..=2147483647`
101
+ = help: consider using `u32` instead
93
102
94
103
error: literal out of range for `i32`
95
104
--> $DIR/lint-type-overflow.rs:36:19
@@ -98,6 +107,7 @@ LL | let x: i32 = -2147483649;
98
107
| ^^^^^^^^^^
99
108
|
100
109
= note: the literal `2147483649` does not fit into the type `i32` whose range is `-2147483648..=2147483647`
110
+ = help: consider using `i64` instead
101
111
102
112
error: literal out of range for `i32`
103
113
--> $DIR/lint-type-overflow.rs:37:14
@@ -106,6 +116,7 @@ LL | let x = -2147483649_i32;
106
116
| ^^^^^^^^^^^^^^
107
117
|
108
118
= note: the literal `2147483649_i32` does not fit into the type `i32` whose range is `-2147483648..=2147483647`
119
+ = help: consider using `i64` instead
109
120
110
121
error: literal out of range for `i32`
111
122
--> $DIR/lint-type-overflow.rs:38:13
@@ -114,6 +125,7 @@ LL | let x = 2147483648;
114
125
| ^^^^^^^^^^
115
126
|
116
127
= note: the literal `2147483648` does not fit into the type `i32` whose range is `-2147483648..=2147483647`
128
+ = help: consider using `u32` instead
117
129
118
130
error: literal out of range for `i64`
119
131
--> $DIR/lint-type-overflow.rs:40:13
@@ -122,6 +134,7 @@ LL | let x = 9223372036854775808_i64;
122
134
| ^^^^^^^^^^^^^^^^^^^^^^^
123
135
|
124
136
= note: the literal `9223372036854775808_i64` does not fit into the type `i64` whose range is `-9223372036854775808..=9223372036854775807`
137
+ = help: consider using `u64` instead
125
138
126
139
error: literal out of range for `i64`
127
140
--> $DIR/lint-type-overflow.rs:42:13
@@ -130,6 +143,7 @@ LL | let x = 18446744073709551615_i64;
130
143
| ^^^^^^^^^^^^^^^^^^^^^^^^
131
144
|
132
145
= note: the literal `18446744073709551615_i64` does not fit into the type `i64` whose range is `-9223372036854775808..=9223372036854775807`
146
+ = help: consider using `u64` instead
133
147
134
148
error: literal out of range for `i64`
135
149
--> $DIR/lint-type-overflow.rs:43:19
@@ -138,6 +152,7 @@ LL | let x: i64 = -9223372036854775809;
138
152
| ^^^^^^^^^^^^^^^^^^^
139
153
|
140
154
= note: the literal `9223372036854775809` does not fit into the type `i64` whose range is `-9223372036854775808..=9223372036854775807`
155
+ = help: consider using `i128` instead
141
156
142
157
error: literal out of range for `i64`
143
158
--> $DIR/lint-type-overflow.rs:44:14
@@ -146,6 +161,7 @@ LL | let x = -9223372036854775809_i64;
146
161
| ^^^^^^^^^^^^^^^^^^^^^^^
147
162
|
148
163
= note: the literal `9223372036854775809_i64` does not fit into the type `i64` whose range is `-9223372036854775808..=9223372036854775807`
164
+ = help: consider using `i128` instead
149
165
150
166
error: aborting due to 18 previous errors
151
167
0 commit comments