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