Skip to content

Commit 30c5125

Browse files
update formating
1 parent eace240 commit 30c5125

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

compiler/rustc_middle/src/mir/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,8 @@ impl<'tcx> LocalDecl<'tcx> {
962962
opt_ty_info: _,
963963
opt_match_place: _,
964964
pat_span: _,
965-
}) | BindingForm::ImplicitSelf(ImplicitSelfKind::Imm),
965+
})
966+
| BindingForm::ImplicitSelf(ImplicitSelfKind::Imm),
966967
)))
967968
)
968969
}
@@ -979,7 +980,8 @@ impl<'tcx> LocalDecl<'tcx> {
979980
opt_ty_info: _,
980981
opt_match_place: _,
981982
pat_span: _,
982-
}) | BindingForm::ImplicitSelf(_),
983+
})
984+
| BindingForm::ImplicitSelf(_),
983985
)))
984986
)
985987
}

compiler/rustc_mir/src/transform/check_consts/validation.rs

+16-6
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
492492
// Special-case reborrows to be more like a copy of a reference.
493493
match *rvalue {
494494
Rvalue::Ref(_, kind, place) => {
495-
if let Some(place_ref) = place_as_reborrow(self.tcx, self.body, place) {
495+
if let Some(reborrowed_place_ref) = place_as_reborrow(self.tcx, self.body, place) {
496496
let ctx = match kind {
497497
BorrowKind::Shared => {
498498
PlaceContext::NonMutatingUse(NonMutatingUseContext::SharedBorrow)
@@ -507,21 +507,31 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
507507
PlaceContext::MutatingUse(MutatingUseContext::Borrow)
508508
}
509509
};
510-
self.visit_local(&place.local, ctx, location);
511-
self.visit_projection(place.local, place_ref.projection, ctx, location);
510+
self.visit_local(&reborrowed_place_ref.local, ctx, location);
511+
self.visit_projection(
512+
reborrowed_place_ref.local,
513+
reborrowed_place_ref.projection,
514+
ctx,
515+
location,
516+
);
512517
return;
513518
}
514519
}
515520
Rvalue::AddressOf(mutbl, place) => {
516-
if let Some(place_ref) = place_as_reborrow(self.tcx, self.body, place) {
521+
if let Some(reborrowed_place_ref) = place_as_reborrow(self.tcx, self.body, place) {
517522
let ctx = match mutbl {
518523
Mutability::Not => {
519524
PlaceContext::NonMutatingUse(NonMutatingUseContext::AddressOf)
520525
}
521526
Mutability::Mut => PlaceContext::MutatingUse(MutatingUseContext::AddressOf),
522527
};
523-
self.visit_local(&place.local, ctx, location);
524-
self.visit_projection(place.local, place_ref.projection, ctx, location);
528+
self.visit_local(&reborrowed_place_ref.local, ctx, location);
529+
self.visit_projection(
530+
reborrowed_place_ref.local,
531+
reborrowed_place_ref.projection,
532+
ctx,
533+
location,
534+
);
525535
return;
526536
}
527537
}

0 commit comments

Comments
 (0)