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>(
781781 let operand = operand. load_scalar ( fx) ;
782782 lval. write_cvalue ( fx, CValue :: by_val ( operand, box_layout) ) ;
783783 }
784- Rvalue :: NullaryOp ( null_op, ty) => {
784+ Rvalue :: NullaryOp ( ref null_op, ty) => {
785785 assert ! ( lval. layout( ) . ty. is_sized( fx. tcx, ParamEnv :: reveal_all( ) ) ) ;
786786 let layout = fx. layout_of ( fx. monomorphize ( ty) ) ;
787787 let val = match null_op {
788788 NullOp :: SizeOf => layout. size . bytes ( ) ,
789789 NullOp :: AlignOf => layout. align . abi . bytes ( ) ,
790+ NullOp :: OffsetOf ( fields) => {
791+ layout. offset_of_subfield ( fx, fields. iter ( ) . map ( |f| f. index ( ) ) ) . bytes ( )
792+ }
790793 } ;
791794 let val = CValue :: const_val ( fx, fx. layout_of ( fx. tcx . types . usize ) , val. into ( ) ) ;
792795 lval. write_cvalue ( fx, val) ;
You can’t perform that action at this time.
0 commit comments