From 422e5edd28bba8599bf3e816f67d2746528c1af8 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 21 Jun 2016 09:43:27 +0200 Subject: [PATCH] error message improvements --- src/error.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/error.rs b/src/error.rs index 9725e9aafc4..da5d8cf787f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -85,11 +85,11 @@ impl<'tcx> fmt::Display for EvalError<'tcx> { EvalError::FunctionPointerTyMismatch(expected, got) => write!(f, "tried to call a function of type {:?} through a function pointer of type {:?}", expected, got), EvalError::ArrayIndexOutOfBounds(span, len, index) => - write!(f, "array index {} out of bounds {} at {:?}", index, len, span), + write!(f, "index out of bounds: the len is {} but the index is {} at {:?}", len, index, span), EvalError::Math(span, ref err) => - write!(f, "mathematical operation at {:?} failed with {:?}", span, err), + write!(f, "{:?} at {:?}", err, span), EvalError::InvalidChar(c) => - write!(f, "invalid utf8 character: {}", c), + write!(f, "tried to interpret an invalid 32-bit value as a char: {}", c), _ => write!(f, "{}", self.description()), } }