You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
:7:18: 7:27 error: the trait bound _: std::ops::Rem<_> is not satisfied [E0277]
:7 let result = -0.25 % 2;
^~~~~~~~~
:7:18: 7:27 help: see the detailed explanation for E0277
:7:18: 7:27 help: the following implementations were found:
:7:18: 7:27 help:
:7:18: 7:27 help: <&'a f64 as std::ops::Rem>
:7:18: 7:27 help: <f64 as std::ops::Rem<&'a f64>>
:7:18: 7:27 help: <&'b f64 as std::ops::Rem<&'a f64>>
:7:18: 7:27 help: and 54 others
error: aborting due to previous error
This is the fix:
let result = -0.25 % 2.0;
This is a really compilicated error message for the fact, that calucating with different types are not allowed.
The text was updated successfully, but these errors were encountered:
Explicit help message for binop type mismatch
When trying to do `1 + Some(2)`, or some other binary operation on two
types different types without an appropriate trait implementation, provide
an explicit help message:
```rust
help: `{integer} + std::option::Option<{integer}>` has no implementation
```
Re: #39579, #38564, #37626, #39942, #34698.
Fixed today, I think. We don't give a suggestion as to float % float but I don't really think that's feasible.
rustc 1.19.0-dev (5dfcd85fd 2017-05-19)
error[E0277]: the trait bound `{float}: std::ops::Rem<{integer}>` is not satisfied
--> test.rs:2:14
|
2 | let result = -0.25 % 2;}
| ^^^^^^^^^ the trait `std::ops::Rem<{integer}>` is not implemented for `{float}`
|
= note: no implementation for `{float} % {integer}`
error: aborting due to previous error
This yields with rust 1.9
let result = -0.25 % 2;
following error message:
This is the fix:
let result = -0.25 % 2.0;
This is a really compilicated error message for the fact, that calucating with different types are not allowed.
The text was updated successfully, but these errors were encountered: