Skip to content

Commit 5f1caa4

Browse files
committed
./x.py fmt
1 parent 22a4827 commit 5f1caa4

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
@@ -274,8 +274,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
274274
let description = if place.projection.len() == 1 {
275275
format!("static item `{}`", self.describe_place(place.as_ref()).unwrap())
276276
} else {
277-
let base_static =
278-
PlaceRef { local: place.local, projection: &[ProjectionElem::Deref] };
277+
let base_static = PlaceRef { local: place.local, projection: &[ProjectionElem::Deref] };
279278

280279
format!(
281280
"`{:?}` 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
@@ -414,8 +414,7 @@ impl<'a, 'tcx> UnsafetyChecker<'a, 'tcx> {
414414
match elem {
415415
ProjectionElem::Field(..) => {
416416
let ty =
417-
Place::ty_from(place.local, proj_base, &self.body.local_decls, self.tcx)
418-
.ty;
417+
Place::ty_from(place.local, proj_base, &self.body.local_decls, self.tcx).ty;
419418
match ty.kind {
420419
ty::Adt(def, _) => match self.tcx.layout_scalar_valid_range(def.did) {
421420
(Bound::Unbounded, Bound::Unbounded) => {}

0 commit comments

Comments
 (0)