Skip to content

Commit b01f81b

Browse files
committed
remark about the one place where place computation calls size_and_align_of
1 parent 0f6d363 commit b01f81b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/librustc_mir/interpret/place.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,11 @@ where
389389
// above). In that case, all fields are equal.
390390
let field_layout = base.layout.field(self, usize::try_from(field).unwrap_or(0))?;
391391

392-
// Offset may need adjustment for unsized fields
392+
// Offset may need adjustment for unsized fields.
393393
let (meta, offset) = if field_layout.is_unsized() {
394-
// re-use parent metadata to determine dynamic field layout
394+
// Re-use parent metadata to determine dynamic field layout.
395+
// With custom DSTS, this *will* execute user-defined code, but the same
396+
// happens at run-time so that's okay.
395397
let align = match self.size_and_align_of(base.meta, field_layout)? {
396398
Some((_, align)) => align,
397399
None if offset == Size::ZERO =>

0 commit comments

Comments
 (0)