Support enum variants in offset_of!
This commit is contained in:
parent
aed0ed2875
commit
03c9acdd8f
@ -766,7 +766,7 @@ fn is_fat_ptr<'tcx>(fx: &FunctionCx<'_, '_, 'tcx>, ty: Ty<'tcx>) -> bool {
|
||||
NullOp::SizeOf => layout.size.bytes(),
|
||||
NullOp::AlignOf => layout.align.abi.bytes(),
|
||||
NullOp::OffsetOf(fields) => {
|
||||
layout.offset_of_subfield(fx, fields.iter().map(|f| f.index())).bytes()
|
||||
layout.offset_of_subfield(fx, fields.iter()).bytes()
|
||||
}
|
||||
};
|
||||
let val = CValue::by_val(
|
||||
|
Loading…
Reference in New Issue
Block a user