Closed
Description
fn main() {
let x : f32 = 1.0;
let y = x / 10; //error: the trait `core::ops::Div<_>` is not implemented for the type `f32`
}
The error message is confusing because it reads as though you cannot divide f32
s at all when the real issue is that you can't divide a f32
by any other numeric type. The error message should at least say something about the different numeric types involved. Ideally it would suggest changing 10
to 10.0
or casting the term.