use crate::build::ForGuard::{OutsideGuard, RefWithinGuard};
use crate::build::{BlockAnd, BlockAndExtension, Builder};
use crate::hair::*;
-use rustc::mir::interpret::InterpError::BoundsCheck;
+use rustc::mir::interpret::{PanicInfo::BoundsCheck};
use rustc::mir::*;
use rustc::ty::{CanonicalUserTypeAnnotation, Variance};
let (usize_ty, bool_ty) = (this.hir.usize_ty(), this.hir.bool_ty());
let slice = unpack!(block = this.as_place(block, lhs));
- // region_scope=None so place indexes live forever. They are scalars so they
- // do not need storage annotations, and they are often copied between
- // places.
// Making this a *fresh* temporary also means we do not have to worry about
// the index changing later: Nothing will ever change this temporary.
// The "retagging" transformation (for Stacked Borrows) relies on this.
- let idx = unpack!(block = this.as_temp(block, None, index, Mutability::Mut));
+ let idx = unpack!(block = this.as_temp(
+ block,
+ expr.temp_lifetime,
+ index,
+ Mutability::Not,
+ ));
// bounds check:
let (len, lt) = (
};
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));