Skip to content

Commit

Permalink
Rustup to rustc 1.31.0-nightly (d586d5d 2018-10-29)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Oct 30, 2018
1 parent 72f47d6 commit cf71df0
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::rustc::mir::interpret::{
read_target_uint, AllocId, AllocType, Allocation, ConstValue, EvalResult, GlobalId, Scalar,
};
use crate::rustc::ty::Const;
use crate::rustc_mir::interpret::{EvalContext, Machine, Memory, MemoryKind, OpTy, PlaceTy, Pointer};
use crate::rustc_mir::interpret::{EvalContext, Machine, Memory, MemoryKind, MemPlace, OpTy, PlaceTy, Pointer};
use std::borrow::Cow;

#[derive(Default)]
Expand Down Expand Up @@ -131,7 +131,7 @@ fn trans_const_place<'a, 'tcx: 'a>(
let op = ecx.const_to_op(const_)?;
let ptr = ecx.allocate(op.layout, MemoryKind::Stack)?;
ecx.copy_op(op, ptr.into())?;
let alloc = ecx.memory.get(ptr.to_ptr()?.alloc_id)?;
let alloc = ecx.memory().get(ptr.to_ptr()?.alloc_id)?;
Ok(fx.tcx.intern_const_alloc(alloc.clone()))
};
let alloc = result().expect("unable to convert ConstValue to Allocation");
Expand Down Expand Up @@ -318,10 +318,6 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter {
panic!();
}

fn static_with_default_tag(alloc: &Allocation) -> Cow<Allocation<()>> {
Cow::Borrowed(alloc)
}

fn ptr_op(
_: &EvalContext<'a, 'mir, 'tcx, Self>,
_: mir::BinOp,
Expand All @@ -337,11 +333,19 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter {
panic!();
}

fn tag_reference(_: &mut EvalContext<'a, 'mir, 'tcx, Self>, _: Pointer<()>, _: Ty<'tcx>, _: Size, _: Option<BorrowKind>) -> EvalResult<'tcx> {
panic!();
fn tag_reference(_: &mut EvalContext<'a, 'mir, 'tcx, Self>, _: MemPlace, _: Ty<'tcx>, _: Size, _: Option<crate::rustc::hir::Mutability>) -> EvalResult<'tcx, MemPlace> {
panic!()
}

fn tag_dereference(_: &EvalContext<'a, 'mir, 'tcx, Self>, _: Pointer<()>, _: Ty<'tcx>) -> EvalResult<'tcx> {
fn tag_dereference(_: &EvalContext<'a, 'mir, 'tcx, Self>, _: MemPlace, _: Ty<'tcx>, _: Size, _: Option<crate::rustc::hir::Mutability>) -> EvalResult<'tcx, MemPlace> {
panic!();
}

fn adjust_static_allocation(alloc: &Allocation) -> Cow<'_, Allocation> {
Cow::Borrowed(alloc)
}

fn tag_new_allocation(_: &mut EvalContext<'a, 'mir, 'tcx, Self>, ptr: Pointer, _: MemoryKind<!>) -> EvalResult<'tcx, Pointer> {
Ok(ptr)
}
}

0 comments on commit cf71df0

Please sign in to comment.