1
Fork 0

Update based on wesleywiser review

This commit is contained in:
George Bateman 2023-10-31 23:41:40 +00:00
parent 9d6ce61376
commit e742f809f6
No known key found for this signature in database
GPG key ID: C417AA9C4039EFCF
4 changed files with 15 additions and 8 deletions

View file

@ -467,9 +467,9 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
let val = match null_op {
NullOp::SizeOf => layout.size.bytes(),
NullOp::AlignOf => layout.align.abi.bytes(),
NullOp::OffsetOf(fields) => layout
.offset_of_subfield(&self.ecx, fields.iter().map(|f| f.index()))
.bytes(),
NullOp::OffsetOf(fields) => {
layout.offset_of_subfield(&self.ecx, fields.iter()).bytes()
}
};
let usize_layout = self.ecx.layout_of(self.tcx.types.usize).unwrap();
let imm = ImmTy::try_from_uint(val, usize_layout)?;