On 22/06/14 07:43 PM, Vadim Chugunov wrote:
> Makes sense, but I am curious, how do you see adding this post-1.0?  
> Would you:
> - add overflow-checked int types and tell everybody to use them instead
> of the default ones from that point on
> - declare that in Rust2 integers are overflow-checked, and have
> everybody port their Rust1 code.  (Well, in reality, I would expect that
> most existing code would just continue to work, but some testing will be
> needed).
> Both sound somewhat painful.

It could be done by adding overflow-checked arithmetic operators. A lint
could then be added to warn about uses of the unchecked operators.

The lint would be opt-in, so you could flip it on at the crate level and
then disable it for audited functions.

It would be backwards compatible (post 1.0 feature) and wouldn't change
the meaning of any existing code by introducing dialects via compiler
switches.

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to