Commit Graph

7 Commits

Author SHA1 Message Date
Oliver Schneider
7bde56e149 typestrong constant integers 2016-03-10 12:50:12 +01:00
Felix S. Klock II
e919f82da1 Address arith-overflow and error-handling in const_eval.rs.
1. Detect and report arithmetic overflow during const-expr eval.

 2. Instead `eval_const_expr_partial` returning `Err(String)`, it now
    has a dedicated enum of different cases. The main benefit of this
    is the ability to pass along an interpretable payload, namely the
    two inputs that caused an overlfow.

I attempted to minimize fallout to error output in tests, but some was
unavoidable. Those changes are in a follow-on commit.
2015-03-03 12:10:57 +01:00
Derek Guenther
730bdb6403 Added tests to make tidy 2014-02-07 12:49:24 -06:00
Brendan Zabarauskas
ee26c7c433 Revert rename of Div to Quot 2013-05-01 15:40:05 +10:00
Brendan Zabarauskas
ab8068c9f2 Improve divide-by-zero error messages 2013-04-24 14:20:00 +10:00
Brendan Zabarauskas
01eb5e8ad3 Rename Div operator trait to Quot and Modulo operator trait to Rem 2013-04-22 01:58:53 +10:00
Seo Sanghyeon
3ed39ce26f Handle divide by zero in constant evaluator 2013-01-23 15:07:00 +09:00