diff --git a/src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs b/src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs index 338244307c2c..3b4a853aa21c 100644 --- a/src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs +++ b/src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs @@ -604,8 +604,13 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { cursor = proj_base; match elem { - ProjectionElem::Field(field, _) if union_ty(*local, proj_base).is_some() => { - return Some((PlaceRef { local: *local, projection: proj_base }, field)); + ProjectionElem::Field(field, _) + if union_ty(*local, proj_base).is_some() => + { + return Some(( + PlaceRef { local: *local, projection: proj_base }, + field, + )); } _ => {} } @@ -629,7 +634,10 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { { // FIXME when we avoid clone reuse describe_place closure let describe_base_place = self - .describe_place(PlaceRef { local: *local, projection: proj_base }) + .describe_place(PlaceRef { + local: *local, + projection: proj_base, + }) .unwrap_or_else(|| "_".to_owned()); return Some(( @@ -1513,9 +1521,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { StorageDeadOrDrop::LocalStorageDead | StorageDeadOrDrop::BoxedStorageDead => { assert!( - Place::ty_from(place.local, proj_base, *self.body, tcx) - .ty - .is_box(), + Place::ty_from(place.local, proj_base, *self.body, tcx).ty.is_box(), "Drop of value behind a reference or raw pointer" ); StorageDeadOrDrop::BoxedStorageDead diff --git a/src/librustc_mir/borrow_check/diagnostics/move_errors.rs b/src/librustc_mir/borrow_check/diagnostics/move_errors.rs index a8267b81f57a..14f675c0fdf8 100644 --- a/src/librustc_mir/borrow_check/diagnostics/move_errors.rs +++ b/src/librustc_mir/borrow_check/diagnostics/move_errors.rs @@ -274,8 +274,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { let description = if place.projection.len() == 1 { format!("static item `{}`", self.describe_place(place.as_ref()).unwrap()) } else { - let base_static = - PlaceRef { local: place.local, projection: &[ProjectionElem::Deref] }; + let base_static = PlaceRef { local: place.local, projection: &[ProjectionElem::Deref] }; format!( "`{:?}` as `{:?}` is a static item", diff --git a/src/librustc_mir/transform/check_unsafety.rs b/src/librustc_mir/transform/check_unsafety.rs index 6188414035fc..cf9a5479afb3 100644 --- a/src/librustc_mir/transform/check_unsafety.rs +++ b/src/librustc_mir/transform/check_unsafety.rs @@ -414,8 +414,7 @@ impl<'a, 'tcx> UnsafetyChecker<'a, 'tcx> { match elem { ProjectionElem::Field(..) => { let ty = - Place::ty_from(place.local, proj_base, &self.body.local_decls, self.tcx) - .ty; + Place::ty_from(place.local, proj_base, &self.body.local_decls, self.tcx).ty; match ty.kind { ty::Adt(def, _) => match self.tcx.layout_scalar_valid_range(def.did) { (Bound::Unbounded, Bound::Unbounded) => {}