1
Fork 0

Normalize struct tail properly in disalignment check

This commit is contained in:
Michael Goulet 2024-08-05 16:30:00 -04:00
parent d9dd5509dc
commit f81549c9ca
4 changed files with 172 additions and 15 deletions

View file

@ -22,7 +22,7 @@ where
};
let ty = place.ty(local_decls, tcx).ty;
let unsized_tail = || tcx.struct_tail_with_normalize(ty, |ty| ty, || {});
let unsized_tail = || tcx.struct_tail_erasing_lifetimes(ty, param_env);
match tcx.layout_of(param_env.and(ty)) {
Ok(layout)
if layout.align.abi <= pack