Skip to content
Permalink
Browse files

remark about the one place where place computation calls size_and_ali…

…gn_of
  • Loading branch information...
RalfJung committed Feb 21, 2019
1 parent 0f6d363 commit b01f81be7445ca83a8a9fd51937e3047c22eea09
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/librustc_mir/interpret/place.rs
@@ -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 =>

0 comments on commit b01f81b

Please sign in to comment.
You can’t perform that action at this time.