From 23c87a1f53a502cfca3ced42a33cf1389f6c081e Mon Sep 17 00:00:00 2001 From: Saleem Jaffer Date: Mon, 18 Mar 2019 14:51:08 +0530 Subject: fixed all compilation errors --- src/librustc_codegen_ssa/mir/block.rs | 12 ++++++++---- src/librustc_codegen_ssa/mir/place.rs | 10 +++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'src/librustc_codegen_ssa') diff --git a/src/librustc_codegen_ssa/mir/block.rs b/src/librustc_codegen_ssa/mir/block.rs index 35fd30f34ad..62f454f1b9f 100644 --- a/src/librustc_codegen_ssa/mir/block.rs +++ b/src/librustc_codegen_ssa/mir/block.rs @@ -1,7 +1,7 @@ use rustc::middle::lang_items; use rustc::ty::{self, Ty, TypeFoldable}; use rustc::ty::layout::{self, LayoutOf, HasTyCtxt}; -use rustc::mir; +use rustc::mir::{self, Place, PlaceBase}; use rustc::mir::interpret::EvalErrorKind; use rustc_target::abi::call::{ArgType, FnType, PassMode, IgnoreMode}; use rustc_target::spec::abi::Abi; @@ -621,15 +621,19 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { // but specified directly in the code. This means it gets promoted // and we can then extract the value by evaluating the promoted. mir::Operand::Copy( - mir::Place::Base(mir::PlaceBase::Promoted(box(index, ty))) + Place::Base(PlaceBase::Static( + box mir::Static {promoted: Some(promoted), ty, ..} + )) ) | mir::Operand::Move( - mir::Place::Base(mir::PlaceBase::Promoted(box(index, ty))) + Place::Base(PlaceBase::Static( + box mir::Static {promoted: Some(promoted), ty, ..} + )) ) => { let param_env = ty::ParamEnv::reveal_all(); let cid = mir::interpret::GlobalId { instance: self.instance, - promoted: Some(index), + promoted: Some(promoted), }; let c = bx.tcx().const_eval(param_env.and(cid)); let (llval, ty) = self.simd_shuffle_indices( diff --git a/src/librustc_codegen_ssa/mir/place.rs b/src/librustc_codegen_ssa/mir/place.rs index 0408ccf039f..1608429b070 100644 --- a/src/librustc_codegen_ssa/mir/place.rs +++ b/src/librustc_codegen_ssa/mir/place.rs @@ -408,11 +408,13 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { let result = match *place { mir::Place::Base(mir::PlaceBase::Local(_)) => bug!(), // handled above - mir::Place::Base(mir::PlaceBase::Promoted(box (index, ty))) => { + mir::Place::Base( + mir::PlaceBase::Static(box mir::Static { def_id: _, ty, promoted: Some(promoted) }) + ) => { let param_env = ty::ParamEnv::reveal_all(); let cid = mir::interpret::GlobalId { instance: self.instance, - promoted: Some(index), + promoted: Some(promoted), }; let layout = cx.layout_of(self.monomorphize(&ty)); match bx.tcx().const_eval(param_env.and(cid)) { @@ -435,7 +437,9 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { } } } - mir::Place::Base(mir::PlaceBase::Static(box mir::Static { def_id, ty })) => { + mir::Place::Base( + mir::PlaceBase::Static(box mir::Static { def_id, ty, promoted: None }) + ) => { // NB: The layout of a static may be unsized as is the case when working // with a static that is an extern_type. let layout = cx.layout_of(self.monomorphize(&ty)); -- cgit 1.4.1-3-g733a5