about summary refs log tree commit diff
path: root/src/test/compile-fail/eval-enum.rs
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2015-02-22 16:34:26 +0100
committerFelix S. Klock II <pnkfelix@pnkfx.org>2015-03-03 12:10:57 +0100
commite919f82da1fb9fa0409f8febede311de4a8f1703 (patch)
tree6f6afaca95486b6b6cfad1675952331630efb662 /src/test/compile-fail/eval-enum.rs
parentf9bbef7f448ba843052eb88733c79aa36c35d5ab (diff)
downloadrust-e919f82da1fb9fa0409f8febede311de4a8f1703.tar.gz
rust-e919f82da1fb9fa0409f8febede311de4a8f1703.zip
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.
Diffstat (limited to 'src/test/compile-fail/eval-enum.rs')
-rw-r--r--src/test/compile-fail/eval-enum.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/compile-fail/eval-enum.rs b/src/test/compile-fail/eval-enum.rs
index 92b7b601e4d..ed1327f3118 100644
--- a/src/test/compile-fail/eval-enum.rs
+++ b/src/test/compile-fail/eval-enum.rs
@@ -9,8 +9,8 @@
 // except according to those terms.
 
 enum test {
-    div_zero = 1/0, //~ERROR expected constant: attempted to divide by zero
-    rem_zero = 1%0  //~ERROR expected constant: attempted remainder with a divisor of zero
+    div_zero = 1/0, //~ERROR constant evaluation error: attempted to divide by zero
+    rem_zero = 1%0  //~ERROR constant evaluation error: attempted remainder with a divisor of zero
 }
 
 fn main() {}