remark about the one place where place computation calls size_and_align_of

This commit is contained in:
Ralf Jung 2019-02-21 16:14:31 +01:00
parent 0f6d36375f
commit b01f81be74

View File

@ -389,9 +389,11 @@ where
// above). In that case, all fields are equal.
let field_layout = base.layout.field(self, usize::try_from(field).unwrap_or(0))?;
// Offset may need adjustment for unsized fields
// Offset may need adjustment for unsized fields.
let (meta, offset) = if field_layout.is_unsized() {
// re-use parent metadata to determine dynamic field layout
// 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.
let align = match self.size_and_align_of(base.meta, field_layout)? {
Some((_, align)) => align,
None if offset == Size::ZERO =>