When doing something like:
let mut sum = 5 + 10;
What is the exact type of sum
? Is it an arbitrary-size type which can’t be overflowed?
When doing something like:
let mut sum = 5 + 10;
What is the exact type of sum
? Is it an arbitrary-size type which can’t be overflowed?
There is RFC 212, which states:
Integer literals whose type is unconstrained will default to
i32
If you want there is a clippy lint default_numeric_fallback
that can warn you about unwanted fallback.