@@ -1135,6 +1135,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
1135
1135
// FIXME: Add Checks for these
1136
1136
CastKind :: PointerWithExposedProvenance | CastKind :: PointerExposeProvenance => { }
1137
1137
CastKind :: PointerCoercion ( PointerCoercion :: ReifyFnPointer ) => {
1138
+ // FIXME: check signature compatibility.
1138
1139
check_kinds ! (
1139
1140
op_ty,
1140
1141
"CastKind::{kind:?} input must be a fn item, not {:?}" ,
@@ -1147,7 +1148,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
1147
1148
) ;
1148
1149
}
1149
1150
CastKind :: PointerCoercion ( PointerCoercion :: UnsafeFnPointer ) => {
1150
- // FIXME: check safety
1151
+ // FIXME: check safety and signature compatibility.
1151
1152
check_kinds ! (
1152
1153
op_ty,
1153
1154
"CastKind::{kind:?} input must be a fn pointer, not {:?}" ,
@@ -1160,7 +1161,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
1160
1161
) ;
1161
1162
}
1162
1163
CastKind :: PointerCoercion ( PointerCoercion :: ClosureFnPointer ( ..) ) => {
1163
- // FIXME: check safety & captures
1164
+ // FIXME: check safety, captures, and signature compatibility.
1164
1165
check_kinds ! (
1165
1166
op_ty,
1166
1167
"CastKind::{kind:?} input must be a closure, not {:?}" ,
@@ -1199,7 +1200,8 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
1199
1200
) ;
1200
1201
}
1201
1202
CastKind :: PointerCoercion ( PointerCoercion :: Unsize ) => {
1202
- // FIXME: Add Checks for this
1203
+ // This is used for all `CoerceUnsized` types,
1204
+ // not just pointers/references, so is hard to check.
1203
1205
}
1204
1206
CastKind :: IntToInt | CastKind :: IntToFloat => {
1205
1207
let input_valid = op_ty. is_integral ( ) || op_ty. is_char ( ) || op_ty. is_bool ( ) ;
0 commit comments