Lindsey Kuper wrote:
Our thinking at the time we implemented suffix inference was that if
you went so far as to write the optional type annotation, then you
should get the type you asked for, no questions asked, overflows and
all.  After all, sometimes people do want intentional overflow.  But
if it's causing nasty surprises, then, yeah, it should be revisited.


I think the best thing would be a simple lint check that visits each literal and checks whether it can fit into the type assigned to it. It will catch many simple cases like this one.


Niko
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to