X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_mir%2Fbuild%2Fexpr%2Fas_place.rs;h=7005f274e0e7def29f39b88d373595e4b1751c67;hb=97098f466ad7a72e6690cf45e6ff2d60885396a9;hp=61c57f792c3bafaeea09d208e6d4fc5fb84c58d7;hpb=3730ed9e5b50148d8fb83c4814a19a76ff30de38;p=rust.git diff --git a/src/librustc_mir/build/expr/as_place.rs b/src/librustc_mir/build/expr/as_place.rs index 61c57f792c3..7005f274e0e 100644 --- a/src/librustc_mir/build/expr/as_place.rs +++ b/src/librustc_mir/build/expr/as_place.rs @@ -4,7 +4,7 @@ use crate::build::ForGuard::{OutsideGuard, RefWithinGuard}; use crate::build::{BlockAnd, BlockAndExtension, Builder}; use crate::hair::*; -use rustc::mir::interpret::{InterpError::Panic, PanicMessage::BoundsCheck}; +use rustc::mir::interpret::{PanicInfo::BoundsCheck}; use rustc::mir::*; use rustc::ty::{CanonicalUserTypeAnnotation, Variance}; @@ -105,10 +105,10 @@ fn expr_as_place( ), ); - let msg = Panic(BoundsCheck { + let msg = BoundsCheck { len: Operand::Move(len), index: Operand::Copy(Place::from(idx)), - }); + }; let success = this.assert(block, Operand::Move(lt), true, msg, expr_span); success.and(slice.index(idx)) } @@ -123,10 +123,13 @@ fn expr_as_place( }; block.and(place) } - ExprKind::StaticRef { id } => block.and(Place::Base(PlaceBase::Static(Box::new(Static { - ty: expr.ty, - kind: StaticKind::Static(id), - })))), + ExprKind::StaticRef { id } => block.and(Place { + base: PlaceBase::Static(Box::new(Static { + ty: expr.ty, + kind: StaticKind::Static(id), + })), + projection: None, + }), ExprKind::PlaceTypeAscription { source, user_ty } => { let place = unpack!(block = this.as_place(block, source));