about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHenry Boisdequin <65845077+henryboisdequin@users.noreply.github.com>2021-02-16 07:01:55 +0530
committerHenry Boisdequin <65845077+henryboisdequin@users.noreply.github.com>2021-02-16 07:07:42 +0530
commit30c5125fbe86f48a547a23917dcafab1b3f3ac7e (patch)
treef4524ab1952a3c56072e6d4fdad777a27701782e
parenteace240ebebf46c88959d15bdd634af104de92fe (diff)
update formating
-rw-r--r--compiler/rustc_middle/src/mir/mod.rs6
-rw-r--r--compiler/rustc_mir/src/transform/check_consts/validation.rs22
2 files changed, 20 insertions, 8 deletions
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs
index 718e81c84ed..cd2bea86ea1 100644
--- a/compiler/rustc_middle/src/mir/mod.rs
+++ b/compiler/rustc_middle/src/mir/mod.rs
@@ -962,7 +962,8 @@ impl<'tcx> LocalDecl<'tcx> {
                     opt_ty_info: _,
                     opt_match_place: _,
                     pat_span: _,
-                }) | BindingForm::ImplicitSelf(ImplicitSelfKind::Imm),
+                })
+                | BindingForm::ImplicitSelf(ImplicitSelfKind::Imm),
             )))
         )
     }
@@ -979,7 +980,8 @@ impl<'tcx> LocalDecl<'tcx> {
                     opt_ty_info: _,
                     opt_match_place: _,
                     pat_span: _,
-                }) | BindingForm::ImplicitSelf(_),
+                })
+                | BindingForm::ImplicitSelf(_),
             )))
         )
     }
diff --git a/compiler/rustc_mir/src/transform/check_consts/validation.rs b/compiler/rustc_mir/src/transform/check_consts/validation.rs
index d8e325f1da7..34db0c9ab16 100644
--- a/compiler/rustc_mir/src/transform/check_consts/validation.rs
+++ b/compiler/rustc_mir/src/transform/check_consts/validation.rs
@@ -492,7 +492,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
         // Special-case reborrows to be more like a copy of a reference.
         match *rvalue {
             Rvalue::Ref(_, kind, place) => {
-                if let Some(place_ref) = place_as_reborrow(self.tcx, self.body, place) {
+                if let Some(reborrowed_place_ref) = place_as_reborrow(self.tcx, self.body, place) {
                     let ctx = match kind {
                         BorrowKind::Shared => {
                             PlaceContext::NonMutatingUse(NonMutatingUseContext::SharedBorrow)
@@ -507,21 +507,31 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
                             PlaceContext::MutatingUse(MutatingUseContext::Borrow)
                         }
                     };
-                    self.visit_local(&place.local, ctx, location);
-                    self.visit_projection(place.local, place_ref.projection, ctx, location);
+                    self.visit_local(&reborrowed_place_ref.local, ctx, location);
+                    self.visit_projection(
+                        reborrowed_place_ref.local,
+                        reborrowed_place_ref.projection,
+                        ctx,
+                        location,
+                    );
                     return;
                 }
             }
             Rvalue::AddressOf(mutbl, place) => {
-                if let Some(place_ref) = place_as_reborrow(self.tcx, self.body, place) {
+                if let Some(reborrowed_place_ref) = place_as_reborrow(self.tcx, self.body, place) {
                     let ctx = match mutbl {
                         Mutability::Not => {
                             PlaceContext::NonMutatingUse(NonMutatingUseContext::AddressOf)
                         }
                         Mutability::Mut => PlaceContext::MutatingUse(MutatingUseContext::AddressOf),
                     };
-                    self.visit_local(&place.local, ctx, location);
-                    self.visit_projection(place.local, place_ref.projection, ctx, location);
+                    self.visit_local(&reborrowed_place_ref.local, ctx, location);
+                    self.visit_projection(
+                        reborrowed_place_ref.local,
+                        reborrowed_place_ref.projection,
+                        ctx,
+                        location,
+                    );
                     return;
                 }
             }