@@ -891,9 +891,8 @@ fn get_nullable_type<'tcx>(
891891 } ;
892892 return get_nullable_type ( tcx, typing_env, inner_field_ty) ;
893893 }
894- ty:: Int ( ty) => Ty :: new_int ( tcx, ty) ,
895- ty:: Uint ( ty) => Ty :: new_uint ( tcx, ty) ,
896- ty:: RawPtr ( ty, mutbl) => Ty :: new_ptr ( tcx, ty, mutbl) ,
894+ ty:: Pat ( base, ..) => return get_nullable_type ( tcx, typing_env, base) ,
895+ ty:: Int ( _) | ty:: Uint ( _) | ty:: RawPtr ( ..) => ty,
897896 // As these types are always non-null, the nullable equivalent of
898897 // `Option<T>` of these types are their raw pointer counterparts.
899898 ty:: Ref ( _region, ty, mutbl) => Ty :: new_ptr ( tcx, ty, mutbl) ,
@@ -1240,11 +1239,9 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
12401239 help : Some ( fluent:: lint_improper_ctypes_char_help) ,
12411240 } ,
12421241
1243- ty:: Pat ( ..) => FfiUnsafe {
1244- ty,
1245- reason : fluent:: lint_improper_ctypes_pat_reason,
1246- help : Some ( fluent:: lint_improper_ctypes_pat_help) ,
1247- } ,
1242+ // It's just extra invariants on the type that you need to uphold,
1243+ // but only the base type is relevant for being representable in FFI.
1244+ ty:: Pat ( base, ..) => self . check_type_for_ffi ( acc, base) ,
12481245
12491246 ty:: Int ( ty:: IntTy :: I128 ) | ty:: Uint ( ty:: UintTy :: U128 ) => {
12501247 FfiUnsafe { ty, reason : fluent:: lint_improper_ctypes_128bit, help : None }
0 commit comments