mozilla/rust — pull request #10018 by fhahn (2013-10-22 16:57:39+00:00)
Title: Check inferred integer literals for overflows, closes #4220

I've started working on this issue and pushed a small commit, which adds a range check for integer literals in `middle::const_eval` (no `uint` at the moment) https://github.com/fhahn/rust/commit/feed6161fcbd98ce53ceb47dd59752636062ab12#diff-58f4817150d93d34d850a20426c38371L196 .

At the moment, this patch is just a proof of concept, I'm not sure if there is a better function for the checks in `middle::const_eval`. This patch does not check for overflows after constant folding, eg:

let x: i8 = 99 + 99;