Skip to content

Commit

Permalink
./x.py fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Jan 24, 2020
1 parent e51b5a4 commit afe9928
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
18 changes: 12 additions & 6 deletions src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
));
}
_ => {}
}
Expand All @@ -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((
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_mir/borrow_check/diagnostics/move_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,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",
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_mir/transform/check_unsafety.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,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) => {}
Expand Down

0 comments on commit afe9928

Please sign in to comment.