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