@@ -25,9 +25,9 @@ use rustc_middle::traits::query::NoSolution;
2525use rustc_middle:: ty:: adjustment:: PointerCoercion ;
2626use rustc_middle:: ty:: cast:: CastTy ;
2727use 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,
3131} ;
3232use rustc_middle:: { bug, span_bug} ;
3333use rustc_mir_dataflow:: move_paths:: MoveData ;
@@ -1233,38 +1233,6 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
12331233 ) ;
12341234 }
12351235
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-
12681236 CastKind :: PointerCoercion (
12691237 PointerCoercion :: MutToConstPointer ,
12701238 coercion_source,
0 commit comments