rust/tests/ui/suggestions/unnecessary_dot_for_floatin...

60 lines
1.9 KiB
Plaintext

error[E0308]: mismatched types
--> $DIR/unnecessary_dot_for_floating_point_literal.rs:2:18
|
LL | let _: f64 = 0..10;
| --- ^^^^^ expected `f64`, found `Range<{integer}>`
| |
| expected due to this
|
= note: expected type `f64`
found struct `std::ops::Range<{integer}>`
help: remove the unnecessary `.` operator for a floating point literal
|
LL | let _: f64 = 0.10;
| ~
error[E0308]: mismatched types
--> $DIR/unnecessary_dot_for_floating_point_literal.rs:3:18
|
LL | let _: f64 = 1..;
| --- ^^^ expected `f64`, found `RangeFrom<{integer}>`
| |
| expected due to this
|
= note: expected type `f64`
found struct `RangeFrom<{integer}>`
help: remove the unnecessary `.` operator for a floating point literal
|
LL | let _: f64 = 1.;
| ~
error[E0308]: mismatched types
--> $DIR/unnecessary_dot_for_floating_point_literal.rs:4:18
|
LL | let _: f64 = ..10;
| --- ^^^^ expected `f64`, found `RangeTo<{integer}>`
| |
| expected due to this
|
= note: expected type `f64`
found struct `RangeTo<{integer}>`
help: remove the unnecessary `.` operator and add an integer part for a floating point literal
|
LL | let _: f64 = 0.10;
| ~~
error[E0308]: mismatched types
--> $DIR/unnecessary_dot_for_floating_point_literal.rs:5:18
|
LL | let _: f64 = std::ops::Range { start: 0, end: 1 };
| --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `f64`, found `Range<{integer}>`
| |
| expected due to this
|
= note: expected type `f64`
found struct `std::ops::Range<{integer}>`
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0308`.