./x.py fmt
This commit is contained in:
parent
22a4827dcb
commit
5f1caa4032
3 changed files with 14 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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) => {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue