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
|
@ -680,7 +680,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
bx.cx().const_usize(val)
|
||||
}
|
||||
mir::NullOp::OffsetOf(fields) => {
|
||||
let val = layout.offset_of_subfield(bx.cx(), fields.iter()).bytes();
|
||||
let val = bx
|
||||
.tcx()
|
||||
.offset_of_subfield(bx.param_env(), layout, fields.iter())
|
||||
.bytes();
|
||||
bx.cx().const_usize(val)
|
||||
}
|
||||
mir::NullOp::UbChecks => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue