use rustc::mir;
use rustc::ty::layout::LayoutOf;
-use rustc::mir::interpret::{EvalResult, Scalar, PointerArithmetic};
+use rustc::mir::interpret::{InterpResult, Scalar, PointerArithmetic};
use super::{InterpretCx, Machine};
}
impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M> {
- pub fn run(&mut self) -> EvalResult<'tcx> {
+ pub fn run(&mut self) -> InterpResult<'tcx> {
while self.step()? {}
Ok(())
}
/// Returns `true` as long as there are more things to do.
///
/// This is used by [priroda](https://github.com/oli-obk/priroda)
- pub fn step(&mut self) -> EvalResult<'tcx, bool> {
+ pub fn step(&mut self) -> InterpResult<'tcx, bool> {
if self.stack.is_empty() {
return Ok(false);
}
Ok(true)
}
- fn statement(&mut self, stmt: &mir::Statement<'tcx>) -> EvalResult<'tcx> {
+ fn statement(&mut self, stmt: &mir::Statement<'tcx>) -> InterpResult<'tcx> {
info!("{:?}", stmt);
use rustc::mir::StatementKind::*;
&mut self,
rvalue: &mir::Rvalue<'tcx>,
place: &mir::Place<'tcx>,
- ) -> EvalResult<'tcx> {
+ ) -> InterpResult<'tcx> {
let dest = self.eval_place(place)?;
use rustc::mir::Rvalue::*;
)?;
}
- Cast(kind, ref operand, cast_ty) => {
- debug_assert_eq!(self.monomorphize(cast_ty)?, dest.layout.ty);
+ Cast(kind, ref operand, _) => {
let src = self.eval_operand(operand, None)?;
self.cast(src, kind, dest)?;
}
Ok(())
}
- fn terminator(&mut self, terminator: &mir::Terminator<'tcx>) -> EvalResult<'tcx> {
+ fn terminator(&mut self, terminator: &mir::Terminator<'tcx>) -> InterpResult<'tcx> {
info!("{:?}", terminator.kind);
self.tcx.span = terminator.source_info.span;
self.memory.tcx.span = terminator.source_info.span;