]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/build/expr/as_rvalue.rs
Remove PlaceBase enum and make Place base field be local: Local
[rust.git] / src / librustc_mir / build / expr / as_rvalue.rs
index ee218d84cd8b56dc70f3584b9fed982a7a85bc53..6f7b7258b5a1acb4e00acb1681b511ddf7c62727 100644 (file)
@@ -9,7 +9,7 @@
 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
@@ -393,26 +393,24 @@ fn limit_capture_mutability(
         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!(