]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/borrow_check/mod.rs
Place::as_place_ref is now Place::as_ref
[rust.git] / src / librustc_mir / borrow_check / mod.rs
index b159bf4dd04cd477c7ca167e6f4c0953535b8981..5ec1e514100de1c60d9192b5ede6781a7f4fbdd4 100644 (file)
@@ -560,7 +560,7 @@ fn visit_statement_entry(
                 self.check_if_path_or_subpath_is_moved(
                     location,
                     InitializationRequiringAction::Use,
-                    (place.as_place_ref(), span),
+                    (place.as_ref(), span),
                     flow_state,
                 );
             }
@@ -591,7 +591,7 @@ fn visit_statement_entry(
                         self.check_if_path_or_subpath_is_moved(
                             location,
                             InitializationRequiringAction::Use,
-                            (output.as_place_ref(), o.span),
+                            (output.as_ref(), o.span),
                             flow_state,
                         );
                     } else {
@@ -1154,7 +1154,7 @@ fn mutate_place(
                 self.check_if_path_or_subpath_is_moved(
                     location,
                     InitializationRequiringAction::Update,
-                    (place_span.0.as_place_ref(), place_span.1),
+                    (place_span.0.as_ref(), place_span.1),
                     flow_state,
                 );
             }
@@ -1232,7 +1232,7 @@ fn consume_rvalue(
                 self.check_if_path_or_subpath_is_moved(
                     location,
                     action,
-                    (place.as_place_ref(), span),
+                    (place.as_ref(), span),
                     flow_state,
                 );
             }
@@ -1260,7 +1260,7 @@ fn consume_rvalue(
                 self.check_if_path_or_subpath_is_moved(
                     location,
                     InitializationRequiringAction::Use,
-                    (place.as_place_ref(), span),
+                    (place.as_ref(), span),
                     flow_state,
                 );
             }
@@ -1309,7 +1309,7 @@ fn consume_rvalue(
     fn propagate_closure_used_mut_upvar(&mut self, operand: &Operand<'tcx>) {
         let propagate_closure_used_mut_place = |this: &mut Self, place: &Place<'tcx>| {
             if place.projection.is_some() {
-                if let Some(field) = this.is_upvar_field_projection(place.as_place_ref()) {
+                if let Some(field) = this.is_upvar_field_projection(place.as_ref()) {
                     this.used_mut_upvars.push(field);
                 }
             } else if let PlaceBase::Local(local) = place.base {
@@ -1401,7 +1401,7 @@ fn consume_operand(
                 self.check_if_path_or_subpath_is_moved(
                     location,
                     InitializationRequiringAction::Use,
-                    (place.as_place_ref(), span),
+                    (place.as_ref(), span),
                     flow_state,
                 );
             }
@@ -1419,7 +1419,7 @@ fn consume_operand(
                 self.check_if_path_or_subpath_is_moved(
                     location,
                     InitializationRequiringAction::Use,
-                    (place.as_place_ref(), span),
+                    (place.as_ref(), span),
                     flow_state,
                 );
             }
@@ -1437,7 +1437,7 @@ fn check_for_invalidation_at_exit(
     ) {
         debug!("check_for_invalidation_at_exit({:?})", borrow);
         let place = &borrow.borrowed_place;
-        let root_place = self.prefixes(place.as_place_ref(), PrefixSet::All).last().unwrap();
+        let root_place = self.prefixes(place.as_ref(), PrefixSet::All).last().unwrap();
 
         // FIXME(nll-rfc#40): do more precise destructor tracking here. For now
         // we just know that all locals are dropped at function exit (otherwise
@@ -1996,9 +1996,9 @@ fn check_access_permissions(
                         self.report_mutability_error(
                             place,
                             span,
-                            &Place {
-                                base: _place_err.0.clone(),
-                                projection: _place_err.1.clone(),
+                            PlaceRef {
+                                base: _place_err.0,
+                                projection: _place_err.1,
                             },
                             error_access,
                             location,
@@ -2033,9 +2033,9 @@ fn check_access_permissions(
             self.report_mutability_error(
                 place,
                 span,
-                &Place {
-                    base: the_place_err.0.clone(),
-                    projection: the_place_err.1.clone(),
+                PlaceRef {
+                    base: the_place_err.0,
+                    projection: the_place_err.1,
                 },
                 error_access,
                 location,