1
Fork 0

rustc_monomorphize: Reduce check_move_size() indentation

This commit is contained in:
Martin Nordholts 2023-08-13 08:08:05 +02:00
parent af86069ab1
commit 1f56ff8f26

View file

@ -609,9 +609,10 @@ impl<'a, 'tcx> MirUsedCollector<'a, 'tcx> {
let limit = Size::from_bytes(limit);
let ty = operand.ty(self.body, self.tcx);
let ty = self.monomorphize(ty);
let layout = self.tcx.layout_of(ty::ParamEnv::reveal_all().and(ty));
if let Ok(layout) = layout {
if layout.size > limit {
let Ok(layout) = self.tcx.layout_of(ty::ParamEnv::reveal_all().and(ty)) else { return };
if layout.size <= limit {
return;
}
debug!(?layout);
let source_info = self.body.source_info(location);
debug!(?source_info);
@ -634,9 +635,7 @@ impl<'a, 'tcx> MirUsedCollector<'a, 'tcx> {
size: layout.size.bytes(),
limit: limit.bytes(),
},
)
}
}
);
}
}