@@ -7,10 +7,10 @@ use std::assert_matches::assert_matches;
77use rustc_abi:: { FieldIdx , HasDataLayout , Size } ;
88use rustc_apfloat:: ieee:: { Double , Half , Quad , Single } ;
99use rustc_middle:: mir:: interpret:: { CTFE_ALLOC_SALT , read_target_uint, write_target_uint} ;
10- use rustc_middle:: mir:: { self , BinOp , ConstValue , NonDivergingIntrinsic , NullOp } ;
10+ use rustc_middle:: mir:: { self , BinOp , ConstValue , NonDivergingIntrinsic } ;
1111use rustc_middle:: ty:: layout:: TyAndLayout ;
1212use rustc_middle:: ty:: { Ty , TyCtxt } ;
13- use rustc_middle:: { bug, err_inval , span_bug , ty} ;
13+ use rustc_middle:: { bug, ty} ;
1414use rustc_span:: { Symbol , sym} ;
1515use tracing:: trace;
1616
@@ -638,8 +638,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
638638 rustc_apfloat:: Round :: NearestTiesToEven ,
639639 ) ?,
640640
641- sym:: unaligned_field_offset => self . unaligned_field_offset ( instance, dest) ?,
642-
643641 // Unsupported intrinsic: skip the return_to_block below.
644642 _ => return interp_ok ( false ) ,
645643 }
@@ -649,25 +647,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
649647 interp_ok ( true )
650648 }
651649
652- fn unaligned_field_offset (
653- & mut self ,
654- instance : ty:: Instance < ' tcx > ,
655- dest : & PlaceTy < ' tcx , M :: Provenance > ,
656- ) -> InterpResult < ' tcx , ( ) > {
657- assert_eq ! ( instance. args. len( ) , 1 ) ;
658- let ty = instance. args . type_at ( 0 ) ;
659- match ty. kind ( ) {
660- & ty:: Field ( container, field_path) => {
661- let offset = self . nullary_op ( NullOp :: OffsetOf ( field_path) , container) ?;
662- self . write_immediate ( * offset, dest)
663- }
664- ty:: Alias ( ..) | ty:: Param ( ..) | ty:: Placeholder ( ..) | ty:: Infer ( ..) => {
665- Err ( err_inval ! ( TooGeneric ) ) . into ( )
666- }
667- _ => span_bug ! ( self . cur_span( ) , "expected field representing type, found {ty}" ) ,
668- }
669- }
670-
671650 pub ( super ) fn eval_nondiverging_intrinsic (
672651 & mut self ,
673652 intrinsic : & NonDivergingIntrinsic < ' tcx > ,
0 commit comments