|
1 | | -warning: use of a double negation |
2 | | - --> $DIR/lint-type-overflow2.rs:8:18 |
3 | | - | |
4 | | -LL | let x2: i8 = --128; |
5 | | - | ^^^^^ |
6 | | - | |
7 | | - = note: the prefix `--` could be misinterpreted as a decrement operator which exists in other languages |
8 | | - = note: use `-= 1` if you meant to decrement the value |
9 | | - = note: `#[warn(double_negations)]` on by default |
10 | | -help: add parentheses for clarity |
11 | | - | |
12 | | -LL | let x2: i8 = -(-128); |
13 | | - | + + |
14 | | - |
15 | | -error: literal out of range for `i8` |
16 | | - --> $DIR/lint-type-overflow2.rs:8:20 |
| 1 | +error: literal out of range for `f16` |
| 2 | + --> $DIR/lint-type-overflow2.rs:8:14 |
17 | 3 | | |
18 | | -LL | let x2: i8 = --128; |
19 | | - | ^^^ |
| 4 | +LL | let x = -65520.0_f16; |
| 5 | + | ^^^^^^^^^^^ |
20 | 6 | | |
21 | | - = note: the literal `128` does not fit into the type `i8` whose range is `-128..=127` |
22 | | - = help: consider using the type `u8` instead |
| 7 | + = note: the literal `65520.0_f16` does not fit into the type `f16` and will be converted to `f16::INFINITY` |
23 | 8 | note: the lint level is defined here |
24 | 9 | --> $DIR/lint-type-overflow2.rs:5:9 |
25 | 10 | | |
26 | 11 | LL | #![deny(overflowing_literals)] |
27 | 12 | | ^^^^^^^^^^^^^^^^^^^^ |
28 | 13 |
|
29 | 14 | error: literal out of range for `f16` |
30 | | - --> $DIR/lint-type-overflow2.rs:11:14 |
31 | | - | |
32 | | -LL | let x = -65520.0_f16; |
33 | | - | ^^^^^^^^^^^ |
34 | | - | |
35 | | - = note: the literal `65520.0_f16` does not fit into the type `f16` and will be converted to `f16::INFINITY` |
36 | | - |
37 | | -error: literal out of range for `f16` |
38 | | - --> $DIR/lint-type-overflow2.rs:12:14 |
| 15 | + --> $DIR/lint-type-overflow2.rs:9:14 |
39 | 16 | | |
40 | 17 | LL | let x = 65520.0_f16; |
41 | 18 | | ^^^^^^^^^^^ |
42 | 19 | | |
43 | 20 | = note: the literal `65520.0_f16` does not fit into the type `f16` and will be converted to `f16::INFINITY` |
44 | 21 |
|
45 | 22 | error: literal out of range for `f32` |
46 | | - --> $DIR/lint-type-overflow2.rs:13:14 |
| 23 | + --> $DIR/lint-type-overflow2.rs:10:14 |
47 | 24 | | |
48 | 25 | LL | let x = -3.40282357e+38_f32; |
49 | 26 | | ^^^^^^^^^^^^^^^^^^ |
50 | 27 | | |
51 | 28 | = note: the literal `3.40282357e+38_f32` does not fit into the type `f32` and will be converted to `f32::INFINITY` |
52 | 29 |
|
53 | 30 | error: literal out of range for `f32` |
54 | | - --> $DIR/lint-type-overflow2.rs:14:14 |
| 31 | + --> $DIR/lint-type-overflow2.rs:11:14 |
55 | 32 | | |
56 | 33 | LL | let x = 3.40282357e+38_f32; |
57 | 34 | | ^^^^^^^^^^^^^^^^^^ |
58 | 35 | | |
59 | 36 | = note: the literal `3.40282357e+38_f32` does not fit into the type `f32` and will be converted to `f32::INFINITY` |
60 | 37 |
|
61 | 38 | error: literal out of range for `f64` |
62 | | - --> $DIR/lint-type-overflow2.rs:15:14 |
| 39 | + --> $DIR/lint-type-overflow2.rs:12:14 |
63 | 40 | | |
64 | 41 | LL | let x = -1.7976931348623159e+308_f64; |
65 | 42 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
66 | 43 | | |
67 | 44 | = note: the literal `1.7976931348623159e+308_f64` does not fit into the type `f64` and will be converted to `f64::INFINITY` |
68 | 45 |
|
69 | 46 | error: literal out of range for `f64` |
70 | | - --> $DIR/lint-type-overflow2.rs:16:14 |
| 47 | + --> $DIR/lint-type-overflow2.rs:13:14 |
71 | 48 | | |
72 | 49 | LL | let x = 1.7976931348623159e+308_f64; |
73 | 50 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
74 | 51 | | |
75 | 52 | = note: the literal `1.7976931348623159e+308_f64` does not fit into the type `f64` and will be converted to `f64::INFINITY` |
76 | 53 |
|
77 | 54 | error: literal out of range for `f128` |
78 | | - --> $DIR/lint-type-overflow2.rs:17:14 |
| 55 | + --> $DIR/lint-type-overflow2.rs:14:14 |
79 | 56 | | |
80 | 57 | LL | let x = -1.1897314953572317650857593266280075e+4932_f128; |
81 | 58 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
82 | 59 | | |
83 | 60 | = note: the literal `1.1897314953572317650857593266280075e+4932_f128` does not fit into the type `f128` and will be converted to `f128::INFINITY` |
84 | 61 |
|
85 | 62 | error: literal out of range for `f128` |
86 | | - --> $DIR/lint-type-overflow2.rs:18:14 |
| 63 | + --> $DIR/lint-type-overflow2.rs:15:14 |
87 | 64 | | |
88 | 65 | LL | let x = 1.1897314953572317650857593266280075e+4932_f128; |
89 | 66 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
90 | 67 | | |
91 | 68 | = note: the literal `1.1897314953572317650857593266280075e+4932_f128` does not fit into the type `f128` and will be converted to `f128::INFINITY` |
92 | 69 |
|
93 | | -error: aborting due to 9 previous errors; 1 warning emitted |
| 70 | +error: aborting due to 8 previous errors |
94 | 71 |
|
0 commit comments