Skip to content

Commit

Permalink
Merge branch 'free-pcs-engine' into coupling-graph-engine
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasAlaif committed Oct 11, 2023
2 parents 6bf38d0 + 17ed9fe commit c485102
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion mir-state-analysis/src/utils/repacker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,21 @@ impl<'tcx> Place<'tcx> {
}

pub fn can_deinit(self, repacker: PlaceRepacker<'_, 'tcx>) -> bool {
!self.projects_shared_ref(repacker)
let mut projects_shared_ref = false;
self.projects_ty(
|typ| {
projects_shared_ref = projects_shared_ref
|| typ
.ty
.ref_mutability()
.map(|m| m.is_not())
.unwrap_or_default();
projects_shared_ref = projects_shared_ref && !typ.ty.is_unsafe_ptr();
false
},
repacker,
);
!projects_shared_ref
}

pub fn projects_ty(
Expand Down

0 comments on commit c485102

Please sign in to comment.