@@ -2314,7 +2314,6 @@ fn confirm_param_env_candidate<'cx, 'tcx>(
2314
2314
) {
2315
2315
Ok ( InferOk { value : _, obligations } ) => {
2316
2316
nested_obligations. extend ( obligations) ;
2317
- assoc_ty_own_obligations ( selcx, obligation, & mut nested_obligations) ;
2318
2317
// FIXME(associated_const_equality): Handle consts here as well? Maybe this progress type should just take
2319
2318
// a term instead.
2320
2319
Progress { term : cache_entry. term , obligations : nested_obligations }
@@ -2337,7 +2336,7 @@ fn confirm_impl_candidate<'cx, 'tcx>(
2337
2336
) -> Progress < ' tcx > {
2338
2337
let tcx = selcx. tcx ( ) ;
2339
2338
2340
- let ImplSourceUserDefinedData { impl_def_id, args, mut nested } = impl_impl_source;
2339
+ let ImplSourceUserDefinedData { impl_def_id, args, nested } = impl_impl_source;
2341
2340
let assoc_item_id = obligation. predicate . def_id ;
2342
2341
let trait_def_id = tcx. trait_id_of_impl ( impl_def_id) . unwrap ( ) ;
2343
2342
@@ -2384,62 +2383,10 @@ fn confirm_impl_candidate<'cx, 'tcx>(
2384
2383
) ;
2385
2384
Progress { term : err. into ( ) , obligations : nested }
2386
2385
} else {
2387
- assoc_ty_own_obligations ( selcx, obligation, & mut nested) ;
2388
2386
Progress { term : term. instantiate ( tcx, args) , obligations : nested }
2389
2387
}
2390
2388
}
2391
2389
2392
- // Get obligations corresponding to the predicates from the where-clause of the
2393
- // associated type itself.
2394
- fn assoc_ty_own_obligations < ' cx , ' tcx > (
2395
- selcx : & mut SelectionContext < ' cx , ' tcx > ,
2396
- obligation : & ProjectionTyObligation < ' tcx > ,
2397
- nested : & mut Vec < PredicateObligation < ' tcx > > ,
2398
- ) {
2399
- let tcx = selcx. tcx ( ) ;
2400
- let predicates = tcx
2401
- . predicates_of ( obligation. predicate . def_id )
2402
- . instantiate_own ( tcx, obligation. predicate . args ) ;
2403
- for ( predicate, span) in predicates {
2404
- let normalized = normalize_with_depth_to (
2405
- selcx,
2406
- obligation. param_env ,
2407
- obligation. cause . clone ( ) ,
2408
- obligation. recursion_depth + 1 ,
2409
- predicate,
2410
- nested,
2411
- ) ;
2412
-
2413
- let nested_cause = if matches ! (
2414
- obligation. cause. code( ) ,
2415
- super :: CompareImplItemObligation { .. }
2416
- | super :: CheckAssociatedTypeBounds { .. }
2417
- | super :: AscribeUserTypeProvePredicate ( ..)
2418
- ) {
2419
- obligation. cause . clone ( )
2420
- } else if span. is_dummy ( ) {
2421
- ObligationCause :: new (
2422
- obligation. cause . span ,
2423
- obligation. cause . body_id ,
2424
- super :: ItemObligation ( obligation. predicate . def_id ) ,
2425
- )
2426
- } else {
2427
- ObligationCause :: new (
2428
- obligation. cause . span ,
2429
- obligation. cause . body_id ,
2430
- super :: BindingObligation ( obligation. predicate . def_id , span) ,
2431
- )
2432
- } ;
2433
- nested. push ( Obligation :: with_depth (
2434
- tcx,
2435
- nested_cause,
2436
- obligation. recursion_depth + 1 ,
2437
- obligation. param_env ,
2438
- normalized,
2439
- ) ) ;
2440
- }
2441
- }
2442
-
2443
2390
pub ( crate ) trait ProjectionCacheKeyExt < ' cx , ' tcx > : Sized {
2444
2391
fn from_poly_projection_predicate (
2445
2392
selcx : & mut SelectionContext < ' cx , ' tcx > ,
0 commit comments