remark about the one place where place computation calls size_and_align_of
This commit is contained in:
parent
0f6d36375f
commit
b01f81be74
1 changed files with 4 additions and 2 deletions
|
@ -389,9 +389,11 @@ where
|
||||||
// above). In that case, all fields are equal.
|
// above). In that case, all fields are equal.
|
||||||
let field_layout = base.layout.field(self, usize::try_from(field).unwrap_or(0))?;
|
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() {
|
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)? {
|
let align = match self.size_and_align_of(base.meta, field_layout)? {
|
||||||
Some((_, align)) => align,
|
Some((_, align)) => align,
|
||||||
None if offset == Size::ZERO =>
|
None if offset == Size::ZERO =>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue