use rustc::mir::interpret::PanicInfo;
use rustc::mir::*;
use rustc::ty::{self, Ty, UpvarSubsts};
-use syntax_pos::Span;
+use rustc_span::Span;
impl<'a, 'tcx> Builder<'a, 'tcx> {
/// Returns an rvalue suitable for use until the end of the current
let arg_place = unpack!(block = this.as_place(block, arg));
let mutability = match arg_place.as_ref() {
- PlaceRef { base: &PlaceBase::Local(local), projection: &[] } => {
- this.local_decls[local].mutability
- }
- PlaceRef { base: &PlaceBase::Local(local), projection: &[ProjectionElem::Deref] } => {
+ PlaceRef { local, projection: &[] } => this.local_decls[*local].mutability,
+ PlaceRef { local, projection: &[ProjectionElem::Deref] } => {
debug_assert!(
- this.local_decls[local].is_ref_for_guard(),
+ this.local_decls[*local].is_ref_for_guard(),
"Unexpected capture place",
);
- this.local_decls[local].mutability
+ this.local_decls[*local].mutability
}
PlaceRef {
- ref base,
+ ref local,
projection: &[ref proj_base @ .., ProjectionElem::Field(upvar_index, _)],
}
| PlaceRef {
- ref base,
+ ref local,
projection:
&[ref proj_base @ .., ProjectionElem::Field(upvar_index, _), ProjectionElem::Deref],
} => {
- let place = PlaceRef { base, projection: proj_base };
+ let place = PlaceRef { local, projection: proj_base };
// Not projected from the implicit `self` in a closure.
debug_assert!(