cleanup misinformation regarding has_deref
This commit is contained in:
@@ -60,7 +60,7 @@ impl<'tcx> MirPass<'tcx> for AddRetag {
|
||||
let basic_blocks = body.basic_blocks.as_mut();
|
||||
let local_decls = &body.local_decls;
|
||||
let needs_retag = |place: &Place<'tcx>| {
|
||||
!place.has_deref() // we're not really interested in stores to "outside" locations, they are hard to keep track of anyway
|
||||
!place.is_indirect_first_projection() // we're not really interested in stores to "outside" locations, they are hard to keep track of anyway
|
||||
&& may_contain_reference(place.ty(&*local_decls, tcx).ty, /*depth*/ 3, tcx)
|
||||
&& !local_decls[place.local].is_deref_temp()
|
||||
};
|
||||
|
||||
@@ -154,7 +154,7 @@ impl<'tcx> MutVisitor<'tcx> for Replacer<'_, 'tcx> {
|
||||
fn visit_operand(&mut self, operand: &mut Operand<'tcx>, loc: Location) {
|
||||
if let Operand::Move(place) = *operand
|
||||
// A move out of a projection of a copy is equivalent to a copy of the original projection.
|
||||
&& !place.has_deref()
|
||||
&& !place.is_indirect_first_projection()
|
||||
&& !self.fully_moved.contains(place.local)
|
||||
{
|
||||
*operand = Operand::Copy(place);
|
||||
|
||||
Reference in New Issue
Block a user