1
Fork 0

avoid walk when get_ptr_alloc returns no AllocRef

This commit is contained in:
Rémy Rakic 2022-06-28 22:25:58 +02:00
parent 6d03c8d751
commit d634f14f26

View file

@ -197,6 +197,9 @@ impl<'rt, 'mir, 'tcx: 'mir, M: CompileTimeMachine<'mir, 'tcx, const_eval::Memory
if !alloc.has_relocations() {
return Ok(false);
}
} else {
// We're encountering a ZST here, and can avoid the walk as well.
return Ok(false);
}
}