make size_and_align_of_mplace work on all projectable

This commit is contained in:
Ralf Jung
2025-06-26 10:24:33 +02:00
parent 3790eff4d4
commit 7de39f55dd
9 changed files with 21 additions and 27 deletions

View File

@@ -168,7 +168,7 @@ where
// Re-use parent metadata to determine dynamic field layout.
// With custom DSTS, this *will* execute user-defined code, but the same
// happens at run-time so that's okay.
match self.size_and_align_of(&base_meta, &field_layout)? {
match self.size_and_align_from_meta(&base_meta, &field_layout)? {
Some((_, align)) => {
// For packed types, we need to cap alignment.
let align = if let ty::Adt(def, _) = base.layout().ty.kind()