Fix rebase fallout

This commit is contained in:
Oliver Scherer 2019-06-11 13:23:08 +02:00
parent b52f6f4ca8
commit d6fa4070be
3 changed files with 8 additions and 8 deletions

View File

@ -6,7 +6,7 @@
use rustc::ty::layout::LayoutOf; use rustc::ty::layout::LayoutOf;
use rustc::ty::{Ty, TyCtxt, ParamEnv, self}; use rustc::ty::{Ty, TyCtxt, ParamEnv, self};
use rustc::mir::interpret::{ use rustc::mir::interpret::{
EvalResult, ErrorHandled, InterpResult, ErrorHandled,
}; };
use rustc::hir; use rustc::hir;
use rustc::hir::def_id::DefId; use rustc::hir::def_id::DefId;
@ -63,7 +63,7 @@ impl<'rt, 'a, 'mir, 'tcx> InternVisitor<'rt, 'a, 'mir, 'tcx> {
&mut self, &mut self,
ptr: Pointer, ptr: Pointer,
mutability: Mutability, mutability: Mutability,
) -> EvalResult<'tcx, Option<IsStaticOrFn>> { ) -> InterpResult<'tcx, Option<IsStaticOrFn>> {
trace!( trace!(
"InternVisitor::intern {:?} with {:?}", "InternVisitor::intern {:?} with {:?}",
ptr, mutability, ptr, mutability,
@ -117,8 +117,8 @@ for
fn visit_aggregate( fn visit_aggregate(
&mut self, &mut self,
mplace: MPlaceTy<'tcx>, mplace: MPlaceTy<'tcx>,
fields: impl Iterator<Item=EvalResult<'tcx, Self::V>>, fields: impl Iterator<Item=InterpResult<'tcx, Self::V>>,
) -> EvalResult<'tcx> { ) -> InterpResult<'tcx> {
if let Some(def) = mplace.layout.ty.ty_adt_def() { if let Some(def) = mplace.layout.ty.ty_adt_def() {
if Some(def.did) == self.ecx.tcx.lang_items().unsafe_cell_type() { if Some(def.did) == self.ecx.tcx.lang_items().unsafe_cell_type() {
// We are crossing over an `UnsafeCell`, we can mutate again // We are crossing over an `UnsafeCell`, we can mutate again
@ -138,7 +138,7 @@ for
self.walk_aggregate(mplace, fields) 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. // Handle Reference types, as these are the only relocations supported by const eval.
// Raw pointers (and boxes) are handled by the `leftover_relocations` logic. // Raw pointers (and boxes) are handled by the `leftover_relocations` logic.
let ty = mplace.layout.ty; 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 // 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? // must always be monomorphic, right?
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,
) -> EvalResult<'tcx> { ) -> InterpResult<'tcx> {
let tcx = ecx.tcx; let tcx = ecx.tcx;
let (mutability, base_intern_mode) = match tcx.static_mutability(def_id) { let (mutability, base_intern_mode) = match tcx.static_mutability(def_id) {
Some(hir::Mutability::MutImmutable) => (Mutability::Immutable, InternMode::Static), Some(hir::Mutability::MutImmutable) => (Mutability::Immutable, InternMode::Static),

View File

@ -677,7 +677,7 @@ where
if M::enforce_validity(self) { if M::enforce_validity(self) {
// Data got changed, better make sure it matches the type! // 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(()) Ok(())

View File

@ -567,7 +567,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
}); });
if let Some(Ok(imm)) = imm { if let Some(Ok(imm)) = imm {
match imm { match *imm {
interpret::Immediate::Scalar(ScalarMaybeUndef::Scalar(scalar)) => { interpret::Immediate::Scalar(ScalarMaybeUndef::Scalar(scalar)) => {
*rval = Rvalue::Use( *rval = Rvalue::Use(
self.operand_from_scalar(scalar, value.layout.ty, source_info.span)); self.operand_from_scalar(scalar, value.layout.ty, source_info.span));