about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2017-11-28 12:49:06 +0100
committerFelix S. Klock II <pnkfelix@pnkfx.org>2017-12-13 13:50:40 -0600
commit39e126c0013ca03a6b0abfcad7fdbe361e63b6e7 (patch)
tree5f99ec1e6f52c43e212b4d3a4f5318b1bfe9cb18
parente123117cb7c1b7f8854858721ccbdbca4e918061 (diff)
downloadrust-39e126c0013ca03a6b0abfcad7fdbe361e63b6e7.tar.gz
rust-39e126c0013ca03a6b0abfcad7fdbe361e63b6e7.zip
Refactoring alpha-rename `place` (`BorrowData` field) to `borrowed_place`.
-rw-r--r--src/librustc_mir/borrow_check/error_reporting.rs8
-rw-r--r--src/librustc_mir/borrow_check/mod.rs4
-rw-r--r--src/librustc_mir/dataflow/impls/borrows.rs8
3 files changed, 10 insertions, 10 deletions
diff --git a/src/librustc_mir/borrow_check/error_reporting.rs b/src/librustc_mir/borrow_check/error_reporting.rs
index 186598001da..1d5e09b164a 100644
--- a/src/librustc_mir/borrow_check/error_reporting.rs
+++ b/src/librustc_mir/borrow_check/error_reporting.rs
@@ -96,7 +96,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
             Some(name) => format!("`{}`", name),
             None => "value".to_owned(),
         };
-        let borrow_msg = match self.describe_place(&borrow.place) {
+        let borrow_msg = match self.describe_place(&borrow.borrowed_place) {
             Some(name) => format!("`{}`", name),
             None => "value".to_owned(),
         };
@@ -124,7 +124,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
             span,
             &self.describe_place(place).unwrap_or("_".to_owned()),
             self.retrieve_borrow_span(borrow),
-            &self.describe_place(&borrow.place).unwrap_or("_".to_owned()),
+            &self.describe_place(&borrow.borrowed_place).unwrap_or("_".to_owned()),
             Origin::Mir,
         );
 
@@ -328,7 +328,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
     ) {
         let end_span = borrows.opt_region_end_span(&borrow.region);
         let scope_tree = borrows.scope_tree();
-        let root_place = self.prefixes(&borrow.place, PrefixSet::All).last().unwrap();
+        let root_place = self.prefixes(&borrow.borrowed_place, PrefixSet::All).last().unwrap();
 
         match root_place {
             &Place::Local(local) => {
@@ -357,7 +357,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
             _ => drop_span,
         };
 
-        match (borrow.region, &self.describe_place(&borrow.place)) {
+        match (borrow.region, &self.describe_place(&borrow.borrowed_place)) {
             (RegionKind::ReScope(_), Some(name)) => {
                 self.report_scoped_local_value_does_not_live_long_enough(
                     name, &scope_tree, &borrow, drop_span, borrow_span, proper_span, end_span);
diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs
index 8bfb5fee9f6..98f974aba50 100644
--- a/src/librustc_mir/borrow_check/mod.rs
+++ b/src/librustc_mir/borrow_check/mod.rs
@@ -917,7 +917,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
                                       flow_state: &Flows<'cx, 'gcx, 'tcx>)
     {
         debug!("check_for_invalidation_at_exit({:?})", borrow);
-        let place = &borrow.place;
+        let place = &borrow.borrowed_place;
         let root_place = self.prefixes(place, PrefixSet::All).last().unwrap();
 
         // FIXME(nll-rfc#40): do more precise destructor tracking here. For now
@@ -1792,7 +1792,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
         for i in flow_state.borrows.elems_incoming() {
             let borrowed = &data[i];
 
-            if self.places_conflict(&borrowed.place, place, access) {
+            if self.places_conflict(&borrowed.borrowed_place, place, access) {
                 let ctrl = op(self, i, borrowed);
                 if ctrl == Control::Break { return; }
             }
diff --git a/src/librustc_mir/dataflow/impls/borrows.rs b/src/librustc_mir/dataflow/impls/borrows.rs
index eeb7f32c25c..e6a682e1be9 100644
--- a/src/librustc_mir/dataflow/impls/borrows.rs
+++ b/src/librustc_mir/dataflow/impls/borrows.rs
@@ -49,7 +49,7 @@ pub struct Borrows<'a, 'gcx: 'tcx, 'tcx: 'a> {
 }
 
 // temporarily allow some dead fields: `kind` and `region` will be
-// needed by borrowck; `place` will probably be a MovePathIndex when
+// needed by borrowck; `borrowed_place` will probably be a MovePathIndex when
 // that is extended to include borrowed data paths.
 #[allow(dead_code)]
 #[derive(Debug)]
@@ -57,7 +57,7 @@ pub struct BorrowData<'tcx> {
     pub(crate) location: Location,
     pub(crate) kind: mir::BorrowKind,
     pub(crate) region: Region<'tcx>,
-    pub(crate) place: mir::Place<'tcx>,
+    pub(crate) borrowed_place: mir::Place<'tcx>,
 }
 
 impl<'tcx> fmt::Display for BorrowData<'tcx> {
@@ -69,7 +69,7 @@ impl<'tcx> fmt::Display for BorrowData<'tcx> {
         };
         let region = format!("{}", self.region);
         let region = if region.len() > 0 { format!("{} ", region) } else { region };
-        write!(w, "&{}{}{:?}", region, kind, self.place)
+        write!(w, "&{}{}{:?}", region, kind, self.borrowed_place)
     }
 }
 
@@ -131,7 +131,7 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
                     if is_unsafe_place(self.tcx, self.mir, place) { return; }
 
                     let borrow = BorrowData {
-                        location: location, kind: kind, region: region, place: place.clone(),
+                        location, kind, region, borrowed_place: place.clone(),
                     };
                     let idx = self.idx_vec.push(borrow);
                     self.location_map.insert(location, idx);