@@ -25,9 +25,9 @@ use rustc_middle::traits::query::NoSolution;
25
25
use rustc_middle:: ty:: adjustment:: PointerCoercion ;
26
26
use rustc_middle:: ty:: cast:: CastTy ;
27
27
use rustc_middle:: ty:: {
28
- self , Binder , CanonicalUserTypeAnnotation , CanonicalUserTypeAnnotations , CoroutineArgsExt ,
29
- Dynamic , GenericArgsRef , OpaqueHiddenType , OpaqueTypeKey , RegionVid , Ty , TyCtxt ,
30
- TypeVisitableExt , UserArgs , UserTypeAnnotationIndex , fold_regions,
28
+ self , CanonicalUserTypeAnnotation , CanonicalUserTypeAnnotations , CoroutineArgsExt ,
29
+ GenericArgsRef , OpaqueHiddenType , OpaqueTypeKey , RegionVid , Ty , TyCtxt , TypeVisitableExt ,
30
+ UserArgs , UserTypeAnnotationIndex , fold_regions,
31
31
} ;
32
32
use rustc_middle:: { bug, span_bug} ;
33
33
use rustc_mir_dataflow:: move_paths:: MoveData ;
@@ -1233,38 +1233,6 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
1233
1233
) ;
1234
1234
}
1235
1235
1236
- CastKind :: PointerCoercion ( PointerCoercion :: DynStar , coercion_source) => {
1237
- // get the constraints from the target type (`dyn* Clone`)
1238
- //
1239
- // apply them to prove that the source type `Foo` implements `Clone` etc
1240
- let ( existential_predicates, region) = match ty. kind ( ) {
1241
- Dynamic ( predicates, region, ty:: DynStar ) => ( predicates, region) ,
1242
- _ => panic ! ( "Invalid dyn* cast_ty" ) ,
1243
- } ;
1244
-
1245
- let self_ty = op. ty ( self . body , tcx) ;
1246
-
1247
- let is_implicit_coercion = coercion_source == CoercionSource :: Implicit ;
1248
- self . prove_predicates (
1249
- existential_predicates
1250
- . iter ( )
1251
- . map ( |predicate| predicate. with_self_ty ( tcx, self_ty) ) ,
1252
- location. to_locations ( ) ,
1253
- ConstraintCategory :: Cast { is_implicit_coercion, unsize_to : None } ,
1254
- ) ;
1255
-
1256
- let outlives_predicate = tcx. mk_predicate ( Binder :: dummy (
1257
- ty:: PredicateKind :: Clause ( ty:: ClauseKind :: TypeOutlives (
1258
- ty:: OutlivesPredicate ( self_ty, * region) ,
1259
- ) ) ,
1260
- ) ) ;
1261
- self . prove_predicate (
1262
- outlives_predicate,
1263
- location. to_locations ( ) ,
1264
- ConstraintCategory :: Cast { is_implicit_coercion, unsize_to : None } ,
1265
- ) ;
1266
- }
1267
-
1268
1236
CastKind :: PointerCoercion (
1269
1237
PointerCoercion :: MutToConstPointer ,
1270
1238
coercion_source,
0 commit comments