make it more obvious that the size is not relevant
This commit is contained in:
parent
bb17f71749
commit
5ebd077f54
1 changed files with 4 additions and 3 deletions
|
|
@ -353,9 +353,10 @@ where
|
|||
// Offset may need adjustment for unsized fields
|
||||
let (meta, offset) = if field_layout.is_unsized() {
|
||||
// re-use parent metadata to determine dynamic field layout
|
||||
let (_, align) = self.size_and_align_of(base.meta, field_layout)?
|
||||
// If this is an extern type, we fall back to its static size and alignment.
|
||||
.unwrap_or_else(|| base.layout.size_and_align());
|
||||
let align = self.size_and_align_of(base.meta, field_layout)?
|
||||
.map(|(_, align)| align)
|
||||
// If this is an extern type, we fall back to its static alignment.
|
||||
.unwrap_or_else(|| base.layout.align);
|
||||
(base.meta, offset.abi_align(align))
|
||||
} else {
|
||||
// base.meta could be present; we might be accessing a sized field of an unsized
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue