File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -781,12 +781,15 @@ fn codegen_stmt<'tcx>(
781
781
let operand = operand. load_scalar ( fx) ;
782
782
lval. write_cvalue ( fx, CValue :: by_val ( operand, box_layout) ) ;
783
783
}
784
- Rvalue :: NullaryOp ( null_op, ty) => {
784
+ Rvalue :: NullaryOp ( ref null_op, ty) => {
785
785
assert ! ( lval. layout( ) . ty. is_sized( fx. tcx, ParamEnv :: reveal_all( ) ) ) ;
786
786
let layout = fx. layout_of ( fx. monomorphize ( ty) ) ;
787
787
let val = match null_op {
788
788
NullOp :: SizeOf => layout. size . bytes ( ) ,
789
789
NullOp :: AlignOf => layout. align . abi . bytes ( ) ,
790
+ NullOp :: OffsetOf ( fields) => {
791
+ layout. offset_of_subfield ( fx, fields. iter ( ) . map ( |f| f. index ( ) ) ) . bytes ( )
792
+ }
790
793
} ;
791
794
let val = CValue :: const_val ( fx, fx. layout_of ( fx. tcx . types . usize ) , val. into ( ) ) ;
792
795
lval. write_cvalue ( fx, val) ;
You can’t perform that action at this time.
0 commit comments