error message improvements
This commit is contained in:
parent
2dbd30fa51
commit
422e5edd28
@ -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()),
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user