about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2020-01-24 12:50:13 -0300
committerSantiago Pastorino <spastorino@gmail.com>2020-01-28 10:12:54 -0300
commit5f1caa4032e7bd31aab30a62d07e359a69c56517 (patch)
treeeae534580b7847df931ef614e31f526fb0650cb5 /src
parent22a4827dcbd0b7e1304848364a3f736ca4a0cbe6 (diff)
downloadrust-5f1caa4032e7bd31aab30a62d07e359a69c56517.tar.gz
rust-5f1caa4032e7bd31aab30a62d07e359a69c56517.zip
./x.py fmt
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs18
-rw-r--r--src/librustc_mir/borrow_check/diagnostics/move_errors.rs3
-rw-r--r--src/librustc_mir/transform/check_unsafety.rs3
3 files changed, 14 insertions, 10 deletions
diff --git a/src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs b/src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs
index 338244307c2..3b4a853aa21 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 a8267b81f57..14f675c0fdf 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 6188414035f..cf9a5479afb 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) => {}