@@ -71,7 +71,7 @@ fn clif_type_from_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option<types::Typ
7171 } ,
7272 ty:: FnPtr ( ..) => pointer_ty ( tcx) ,
7373 ty:: RawPtr ( pointee_ty, _) | ty:: Ref ( _, pointee_ty, _) => {
74- if has_ptr_meta ( tcx, * pointee_ty) {
74+ if tcx. type_has_metadata ( * pointee_ty, ty :: TypingEnv :: fully_monomorphized ( ) ) {
7575 return None ;
7676 } else {
7777 pointer_ty ( tcx)
@@ -91,7 +91,7 @@ fn clif_pair_type_from_ty<'tcx>(
9191 ( clif_type_from_ty ( tcx, types[ 0 ] ) ?, clif_type_from_ty ( tcx, types[ 1 ] ) ?)
9292 }
9393 ty:: RawPtr ( pointee_ty, _) | ty:: Ref ( _, pointee_ty, _) => {
94- if has_ptr_meta ( tcx, * pointee_ty) {
94+ if tcx. type_has_metadata ( * pointee_ty, ty :: TypingEnv :: fully_monomorphized ( ) ) {
9595 ( pointer_ty ( tcx) , pointer_ty ( tcx) )
9696 } else {
9797 return None ;
@@ -101,20 +101,6 @@ fn clif_pair_type_from_ty<'tcx>(
101101 } )
102102}
103103
104- /// Is a pointer to this type a wide ptr?
105- pub ( crate ) fn has_ptr_meta < ' tcx > ( tcx : TyCtxt < ' tcx > , ty : Ty < ' tcx > ) -> bool {
106- if ty. is_sized ( tcx, ty:: TypingEnv :: fully_monomorphized ( ) ) {
107- return false ;
108- }
109-
110- let tail = tcx. struct_tail_for_codegen ( ty, ty:: TypingEnv :: fully_monomorphized ( ) ) ;
111- match tail. kind ( ) {
112- ty:: Foreign ( ..) => false ,
113- ty:: Str | ty:: Slice ( ..) | ty:: Dynamic ( ..) => true ,
114- _ => bug ! ( "unexpected unsized tail: {:?}" , tail) ,
115- }
116- }
117-
118104pub ( crate ) fn codegen_icmp_imm (
119105 fx : & mut FunctionCx < ' _ , ' _ , ' _ > ,
120106 intcc : IntCC ,
0 commit comments