We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f6d363 commit b01f81bCopy full SHA for b01f81b
src/librustc_mir/interpret/place.rs
@@ -389,9 +389,11 @@ where
389
// above). In that case, all fields are equal.
390
let field_layout = base.layout.field(self, usize::try_from(field).unwrap_or(0))?;
391
392
- // Offset may need adjustment for unsized fields
+ // Offset may need adjustment for unsized fields.
393
let (meta, offset) = if field_layout.is_unsized() {
394
- // re-use parent metadata to determine dynamic field layout
+ // 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.
397
let align = match self.size_and_align_of(base.meta, field_layout)? {
398
Some((_, align)) => align,
399
None if offset == Size::ZERO =>
0 commit comments