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