Skip to content

Commit

Permalink
Merge pull request #459 from solson/rustup
Browse files Browse the repository at this point in the history
Rustup
  • Loading branch information
RalfJung committed Sep 24, 2018
2 parents 7433c6f + 4b11792 commit f8507d7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2018-09-22
nightly-2018-09-24
21 changes: 13 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,14 @@ pub struct Evaluator<'tcx> {
pub(crate) tls: TlsData<'tcx>,
}

impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
type MemoryData = ();
type MemoryKinds = MiriMemoryKind;

const MUT_STATIC_KIND: Option<MiriMemoryKind> = Some(MiriMemoryKind::MutStatic);
const DETECT_LOOPS: bool = false;

/// Returns Ok() when the function was handled, fail otherwise
fn find_fn<'a>(
fn find_fn(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
instance: ty::Instance<'tcx>,
args: &[OpTy<'tcx>],
Expand All @@ -246,7 +245,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
ecx.find_fn(instance, args, dest, ret)
}

fn call_intrinsic<'a>(
fn call_intrinsic(
ecx: &mut rustc_mir::interpret::EvalContext<'a, 'mir, 'tcx, Self>,
instance: ty::Instance<'tcx>,
args: &[OpTy<'tcx>],
Expand All @@ -255,7 +254,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
ecx.call_intrinsic(instance, args, dest)
}

fn ptr_op<'a>(
fn ptr_op(
ecx: &rustc_mir::interpret::EvalContext<'a, 'mir, 'tcx, Self>,
bin_op: mir::BinOp,
left: Scalar,
Expand All @@ -266,7 +265,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
ecx.ptr_op(bin_op, left, left_layout, right, right_layout)
}

fn box_alloc<'a>(
fn box_alloc(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
dest: PlaceTy<'tcx>,
) -> EvalResult<'tcx> {
Expand Down Expand Up @@ -305,7 +304,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
Ok(())
}

fn find_foreign_static<'a>(
fn find_foreign_static(
tcx: TyCtxtAt<'a, 'tcx, 'tcx>,
def_id: DefId,
) -> EvalResult<'tcx, &'tcx Allocation> {
Expand All @@ -329,7 +328,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
Ok(alloc)
}

fn validation_op<'a>(
fn validation_op(
_ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
_op: ::rustc::mir::ValidationOp,
_operand: &::rustc::mir::ValidationOperand<'tcx, ::rustc::mir::Place<'tcx>>,
Expand All @@ -338,4 +337,10 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
//ecx.validation_op(op, operand)
Ok(())
}

fn before_terminator(_ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>) -> EvalResult<'tcx>
{
// We are not interested in detecting loops
Ok(())
}
}

0 comments on commit f8507d7

Please sign in to comment.