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