1
Fork 0

remove inhabitedness check

This commit is contained in:
Erik Desjardins 2021-03-17 20:31:00 -04:00
parent 1205e82578
commit 93c1380e0b
5 changed files with 7 additions and 9 deletions

View file

@ -16,7 +16,7 @@ impl<'tcx> MirPass<'tcx> for RemoveZsts {
StatementKind::Assign(box (place, _)) => {
let place_ty = place.ty(local_decls, tcx).ty;
if let Ok(layout) = tcx.layout_of(param_env.and(place_ty)) {
if layout.is_zst() && !layout.abi.is_uninhabited() {
if layout.is_zst() {
if tcx.consider_optimizing(|| {
format!(
"RemoveZsts - Place: {:?} SourceInfo: {:?}",