offset_of: allow (unstably) taking the offset of slice tail fields
This commit is contained in:
parent
16e8803579
commit
eb584a23bf
17 changed files with 215 additions and 46 deletions
|
@ -253,7 +253,10 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
|
|||
Scalar::from_target_usize(val, self)
|
||||
}
|
||||
mir::NullOp::OffsetOf(fields) => {
|
||||
let val = layout.offset_of_subfield(self, fields.iter()).bytes();
|
||||
let val = self
|
||||
.tcx
|
||||
.offset_of_subfield(self.param_env, layout, fields.iter())
|
||||
.bytes();
|
||||
Scalar::from_target_usize(val, self)
|
||||
}
|
||||
mir::NullOp::UbChecks => Scalar::from_bool(self.tcx.sess.ub_checks()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue