From d6fa4070bea1cf94b6fbab5028057d5604c600ee Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Tue, 11 Jun 2019 13:23:08 +0200 Subject: [PATCH] Fix rebase fallout --- src/librustc_mir/interpret/intern.rs | 12 ++++++------ src/librustc_mir/interpret/place.rs | 2 +- src/librustc_mir/transform/const_prop.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/librustc_mir/interpret/intern.rs b/src/librustc_mir/interpret/intern.rs index b55129bd4196..a7aee9407a49 100644 --- a/src/librustc_mir/interpret/intern.rs +++ b/src/librustc_mir/interpret/intern.rs @@ -6,7 +6,7 @@ use rustc::ty::layout::LayoutOf; use rustc::ty::{Ty, TyCtxt, ParamEnv, self}; use rustc::mir::interpret::{ - EvalResult, ErrorHandled, + InterpResult, ErrorHandled, }; use rustc::hir; use rustc::hir::def_id::DefId; @@ -63,7 +63,7 @@ fn intern( &mut self, ptr: Pointer, mutability: Mutability, - ) -> EvalResult<'tcx, Option> { + ) -> InterpResult<'tcx, Option> { trace!( "InternVisitor::intern {:?} with {:?}", ptr, mutability, @@ -117,8 +117,8 @@ fn ecx(&self) -> &CompileTimeEvalContext<'a, 'mir, 'tcx> { fn visit_aggregate( &mut self, mplace: MPlaceTy<'tcx>, - fields: impl Iterator>, - ) -> EvalResult<'tcx> { + fields: impl Iterator>, + ) -> InterpResult<'tcx> { if let Some(def) = mplace.layout.ty.ty_adt_def() { if Some(def.did) == self.ecx.tcx.lang_items().unsafe_cell_type() { // We are crossing over an `UnsafeCell`, we can mutate again @@ -138,7 +138,7 @@ fn visit_aggregate( self.walk_aggregate(mplace, fields) } - fn visit_primitive(&mut self, mplace: MPlaceTy<'tcx>) -> EvalResult<'tcx> { + fn visit_primitive(&mut self, mplace: MPlaceTy<'tcx>) -> InterpResult<'tcx> { // Handle Reference types, as these are the only relocations supported by const eval. // Raw pointers (and boxes) are handled by the `leftover_relocations` logic. let ty = mplace.layout.ty; @@ -245,7 +245,7 @@ pub fn intern_const_alloc_recursive( // FIXME(oli-obk): can we scrap the param env? I think we can, the final value of a const eval // must always be monomorphic, right? param_env: ty::ParamEnv<'tcx>, -) -> EvalResult<'tcx> { +) -> InterpResult<'tcx> { let tcx = ecx.tcx; let (mutability, base_intern_mode) = match tcx.static_mutability(def_id) { Some(hir::Mutability::MutImmutable) => (Mutability::Immutable, InternMode::Static), diff --git a/src/librustc_mir/interpret/place.rs b/src/librustc_mir/interpret/place.rs index a721cea85a24..1285549015cd 100644 --- a/src/librustc_mir/interpret/place.rs +++ b/src/librustc_mir/interpret/place.rs @@ -677,7 +677,7 @@ pub fn write_immediate_to_mplace( if M::enforce_validity(self) { // Data got changed, better make sure it matches the type! - self.validate_operand(dest.into(), vec![], None, /*const_mode*/ false)?; + self.validate_operand(dest.into(), vec![], None)?; } Ok(()) diff --git a/src/librustc_mir/transform/const_prop.rs b/src/librustc_mir/transform/const_prop.rs index 805f15e37472..5b567512a7b6 100644 --- a/src/librustc_mir/transform/const_prop.rs +++ b/src/librustc_mir/transform/const_prop.rs @@ -567,7 +567,7 @@ fn replace_with_const( }); if let Some(Ok(imm)) = imm { - match imm { + match *imm { interpret::Immediate::Scalar(ScalarMaybeUndef::Scalar(scalar)) => { *rval = Rvalue::Use( self.operand_from_scalar(scalar, value.layout.ty, source_info.span));