@@ -891,9 +891,8 @@ fn get_nullable_type<'tcx>(
891
891
} ;
892
892
return get_nullable_type ( tcx, typing_env, inner_field_ty) ;
893
893
}
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,
897
896
// As these types are always non-null, the nullable equivalent of
898
897
// `Option<T>` of these types are their raw pointer counterparts.
899
898
ty:: Ref ( _region, ty, mutbl) => Ty :: new_ptr ( tcx, ty, mutbl) ,
@@ -1240,11 +1239,9 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
1240
1239
help : Some ( fluent:: lint_improper_ctypes_char_help) ,
1241
1240
} ,
1242
1241
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) ,
1248
1245
1249
1246
ty:: Int ( ty:: IntTy :: I128 ) | ty:: Uint ( ty:: UintTy :: U128 ) => {
1250
1247
FfiUnsafe { ty, reason : fluent:: lint_improper_ctypes_128bit, help : None }
0 commit comments