11warning: use of a double negation
2- --> $DIR/lint-type-overflow2.rs:6 :18
2+ --> $DIR/lint-type-overflow2.rs:8 :18
33 |
44LL | let x2: i8 = --128;
55 | ^^^^^
@@ -13,50 +13,82 @@ LL | let x2: i8 = -(-128);
1313 | + +
1414
1515error: literal out of range for `i8`
16- --> $DIR/lint-type-overflow2.rs:6 :20
16+ --> $DIR/lint-type-overflow2.rs:8 :20
1717 |
1818LL | let x2: i8 = --128;
1919 | ^^^
2020 |
2121 = note: the literal `128` does not fit into the type `i8` whose range is `-128..=127`
2222 = help: consider using the type `u8` instead
2323note: the lint level is defined here
24- --> $DIR/lint-type-overflow2.rs:3 :9
24+ --> $DIR/lint-type-overflow2.rs:5 :9
2525 |
2626LL | #![deny(overflowing_literals)]
2727 | ^^^^^^^^^^^^^^^^^^^^
2828
29+ 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
39+ |
40+ LL | let x = 65520.0_f16;
41+ | ^^^^^^^^^^^
42+ |
43+ = note: the literal `65520.0_f16` does not fit into the type `f16` and will be converted to `f16::INFINITY`
44+
2945error: literal out of range for `f32`
30- --> $DIR/lint-type-overflow2.rs:9 :14
46+ --> $DIR/lint-type-overflow2.rs:13 :14
3147 |
3248LL | let x = -3.40282357e+38_f32;
3349 | ^^^^^^^^^^^^^^^^^^
3450 |
3551 = note: the literal `3.40282357e+38_f32` does not fit into the type `f32` and will be converted to `f32::INFINITY`
3652
3753error: literal out of range for `f32`
38- --> $DIR/lint-type-overflow2.rs:10 :14
54+ --> $DIR/lint-type-overflow2.rs:14 :14
3955 |
4056LL | let x = 3.40282357e+38_f32;
4157 | ^^^^^^^^^^^^^^^^^^
4258 |
4359 = note: the literal `3.40282357e+38_f32` does not fit into the type `f32` and will be converted to `f32::INFINITY`
4460
4561error: literal out of range for `f64`
46- --> $DIR/lint-type-overflow2.rs:11 :14
62+ --> $DIR/lint-type-overflow2.rs:15 :14
4763 |
4864LL | let x = -1.7976931348623159e+308_f64;
4965 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
5066 |
5167 = note: the literal `1.7976931348623159e+308_f64` does not fit into the type `f64` and will be converted to `f64::INFINITY`
5268
5369error: literal out of range for `f64`
54- --> $DIR/lint-type-overflow2.rs:12 :14
70+ --> $DIR/lint-type-overflow2.rs:16 :14
5571 |
5672LL | let x = 1.7976931348623159e+308_f64;
5773 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
5874 |
5975 = note: the literal `1.7976931348623159e+308_f64` does not fit into the type `f64` and will be converted to `f64::INFINITY`
6076
61- error: aborting due to 5 previous errors; 1 warning emitted
77+ error: literal out of range for `f128`
78+ --> $DIR/lint-type-overflow2.rs:17:14
79+ |
80+ LL | let x = -1.1897314953572317650857593266280075e+4932_f128;
81+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
82+ |
83+ = note: the literal `1.1897314953572317650857593266280075e+4932_f128` does not fit into the type `f128` and will be converted to `f128::INFINITY`
84+
85+ error: literal out of range for `f128`
86+ --> $DIR/lint-type-overflow2.rs:18:14
87+ |
88+ LL | let x = 1.1897314953572317650857593266280075e+4932_f128;
89+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
90+ |
91+ = note: the literal `1.1897314953572317650857593266280075e+4932_f128` does not fit into the type `f128` and will be converted to `f128::INFINITY`
92+
93+ error: aborting due to 9 previous errors; 1 warning emitted
6294
0 commit comments