On page 51 of "Programming Rust" by Jim Blandy & Jason Orendorff the authors state,
Unlike C and C++, Rust performs almost no numeric conversions implicitly.
Why "almost"? What implicit numeric conversions will Rust perform?
Like the comments above I don't know of any such implicit conversion and couldn't find an example, but the Rust by example book states the following about type casts
Rust provides no implicit type conversion (coercion) between primitive types. But, explicit type conversion (casting) can be performed using the
as
keyword.
There is/was a Pre-RFC where this topic got discussed in more detail showing the pro/con arguments about why Rust should/n't have this feature.
For further information you may have a look at the From and Into traits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With