News for hackers. Stuff that matters.
Re:Announcing Rust 1.20 by ComputerGuru on Friday September 01, 2017 @11:19AM (#15149125)
The reason this works the way it does is that rust does not provide any cross-type arithmetic operators; as in you can't multiply a signed int and unsigned int or a float and an u8 without casting one of them to the same type as the other.

That means for the example you posted works is because the only valid operation that line of code can be resolved to as-is would be the case where all untyped values are inferred to be float by the inference engine.

There are no comments on this comment yet.