Skip to content

Commit afe9928

Browse files
committed
./x.py fmt
1 parent e51b5a4 commit afe9928

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,13 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
604604
cursor = proj_base;
605605

606606
match elem {
607-
ProjectionElem::Field(field, _) if union_ty(*local, proj_base).is_some() => {
608-
return Some((PlaceRef { local: *local, projection: proj_base }, field));
607+
ProjectionElem::Field(field, _)
608+
if union_ty(*local, proj_base).is_some() =>
609+
{
610+
return Some((
611+
PlaceRef { local: *local, projection: proj_base },
612+
field,
613+
));
609614
}
610615
_ => {}
611616
}
@@ -629,7 +634,10 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
629634
{
630635
// FIXME when we avoid clone reuse describe_place closure
631636
let describe_base_place = self
632-
.describe_place(PlaceRef { local: *local, projection: proj_base })
637+
.describe_place(PlaceRef {
638+
local: *local,
639+
projection: proj_base,
640+
})
633641
.unwrap_or_else(|| "_".to_owned());
634642

635643
return Some((
@@ -1513,9 +1521,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
15131521
StorageDeadOrDrop::LocalStorageDead
15141522
| StorageDeadOrDrop::BoxedStorageDead => {
15151523
assert!(
1516-
Place::ty_from(place.local, proj_base, *self.body, tcx)
1517-
.ty
1518-
.is_box(),
1524+
Place::ty_from(place.local, proj_base, *self.body, tcx).ty.is_box(),
15191525
"Drop of value behind a reference or raw pointer"
15201526
);
15211527
StorageDeadOrDrop::BoxedStorageDead

src/librustc_mir/borrow_check/diagnostics/move_errors.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
273273
let description = if place.projection.len() == 1 {
274274
format!("static item `{}`", self.describe_place(place.as_ref()).unwrap())
275275
} else {
276-
let base_static =
277-
PlaceRef { local: place.local, projection: &[ProjectionElem::Deref] };
276+
let base_static = PlaceRef { local: place.local, projection: &[ProjectionElem::Deref] };
278277

279278
format!(
280279
"`{:?}` as `{:?}` is a static item",

src/librustc_mir/transform/check_unsafety.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,7 @@ impl<'a, 'tcx> UnsafetyChecker<'a, 'tcx> {
412412
match elem {
413413
ProjectionElem::Field(..) => {
414414
let ty =
415-
Place::ty_from(place.local, proj_base, &self.body.local_decls, self.tcx)
416-
.ty;
415+
Place::ty_from(place.local, proj_base, &self.body.local_decls, self.tcx).ty;
417416
match ty.kind {
418417
ty::Adt(def, _) => match self.tcx.layout_scalar_valid_range(def.did) {
419418
(Bound::Unbounded, Bound::Unbounded) => {}

0 commit comments

Comments
 (0)