-nightly-2019-03-29
+nightly-2019-04-03
let mut args = this.frame().mir.args_iter();
let arg_local = args.next().ok_or_else(||
- EvalErrorKind::AbiViolation(
+ InterpError::AbiViolation(
"Argument to __rust_maybe_catch_panic does not take enough arguments."
.to_owned(),
),
// This is `libc::pthread_key_t`.
let key_type = args[0].layout.ty
.builtin_deref(true)
- .ok_or_else(|| EvalErrorKind::AbiViolation("wrong signature used for `pthread_key_create`: first argument must be a raw pointer.".to_owned()))?
+ .ok_or_else(|| InterpError::AbiViolation("wrong signature used for `pthread_key_create`: first argument must be a raw pointer.".to_owned()))?
.ty;
let key_layout = this.layout_of(key_type)?;
})
.ok_or_else(|| {
let path = path.iter().map(|&s| s.to_owned()).collect();
- EvalErrorKind::PathNotFound(path).into()
+ InterpError::PathNotFound(path).into()
})
}
let pointee_size = self.layout_of(pointee_ty)?.size.bytes() as i64;
let offset = offset
.checked_mul(pointee_size)
- .ok_or_else(|| EvalErrorKind::Overflow(mir::BinOp::Mul))?;
+ .ok_or_else(|| InterpError::Overflow(mir::BinOp::Mul))?;
// Now let's see what kind of pointer this is.
if let Scalar::Ptr(ptr) = ptr {
// Both old and new pointer must be in-bounds of a *live* allocation.
use rustc::mir::RetagKind;
use crate::{
- EvalResult, EvalErrorKind, MiriEvalContext, HelpersEvalContextExt, Evaluator, MutValueVisitor,
+ EvalResult, InterpError, MiriEvalContext, HelpersEvalContextExt, Evaluator, MutValueVisitor,
MemoryKind, MiriMemoryKind, RangeMap, AllocId, Allocation, AllocationExtra,
Pointer, Immediate, ImmTy, PlaceTy, MPlaceTy,
};
ptr.tag, kind, ptr, size.bytes());
let stacks = self.stacks.borrow();
for stack in stacks.iter(ptr.offset, size) {
- stack.deref(ptr.tag, kind).map_err(EvalErrorKind::MachineError)?;
+ stack.deref(ptr.tag, kind).map_err(InterpError::MachineError)?;
}
Ok(())
}
let mut stacks = self.stacks.borrow_mut();
for stack in stacks.iter_mut(ptr.offset, size) {
// Access source `ptr`, create new ref.
- let ptr_idx = stack.deref(ptr.tag, new_kind).map_err(EvalErrorKind::MachineError)?;
+ let ptr_idx = stack.deref(ptr.tag, new_kind).map_err(InterpError::MachineError)?;
// If we can deref the new tag already, and if that tag lives higher on
// the stack than the one we come from, just use that.
// That is, we check if `new_bor` *already* is "derived from" `ptr.tag`.
use rustc::{ty, ty::layout::HasDataLayout, mir};
use crate::{
- EvalResult, EvalErrorKind, StackPopCleanup,
+ EvalResult, InterpError, StackPopCleanup,
MPlaceTy, Scalar, Borrow,
};
StackPopCleanup::None { cleanup: true },
)?;
let arg_local = this.frame().mir.args_iter().next().ok_or_else(
- || EvalErrorKind::AbiViolation("TLS dtor does not take enough arguments.".to_owned()),
+ || InterpError::AbiViolation("TLS dtor does not take enough arguments.".to_owned()),
)?;
let dest = this.eval_place(&mir::Place::Base(mir::PlaceBase::Local(arg_local)))?;
this.write_scalar(ptr, dest)?;