Discard raw pointers from SSA locals.

This commit is contained in:
Camille GILLOT 2023-01-18 22:59:52 +00:00
parent d45815eb4a
commit 8f1dbe54ea
3 changed files with 45 additions and 2 deletions

View file

@ -117,8 +117,10 @@ impl<'tcx> Visitor<'tcx> for SsaLocals {
self.assignments[local].insert(LocationExtended::Plain(loc));
self.assignment_order.push(local);
}
PlaceContext::MutatingUse(_) => self.assignments[local] = Set1::Many,
// Immutable borrows and AddressOf are taken into account in `SsaLocals::new` by
// Anything can happen with raw pointers, so remove them.
PlaceContext::NonMutatingUse(NonMutatingUseContext::AddressOf)
| PlaceContext::MutatingUse(_) => self.assignments[local] = Set1::Many,
// Immutable borrows are taken into account in `SsaLocals::new` by
// removing non-freeze locals.
PlaceContext::NonMutatingUse(_) => {
let set = &mut self.assignments[local];