Skip to content

Commit 23f525c

Browse files
committed
don't register assoc_ty_own_obligations
1 parent 707d8c3 commit 23f525c

File tree

1 file changed

+1
-54
lines changed
  • compiler/rustc_trait_selection/src/traits

1 file changed

+1
-54
lines changed

compiler/rustc_trait_selection/src/traits/project.rs

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2314,7 +2314,6 @@ fn confirm_param_env_candidate<'cx, 'tcx>(
23142314
) {
23152315
Ok(InferOk { value: _, obligations }) => {
23162316
nested_obligations.extend(obligations);
2317-
assoc_ty_own_obligations(selcx, obligation, &mut nested_obligations);
23182317
// FIXME(associated_const_equality): Handle consts here as well? Maybe this progress type should just take
23192318
// a term instead.
23202319
Progress { term: cache_entry.term, obligations: nested_obligations }
@@ -2337,7 +2336,7 @@ fn confirm_impl_candidate<'cx, 'tcx>(
23372336
) -> Progress<'tcx> {
23382337
let tcx = selcx.tcx();
23392338

2340-
let ImplSourceUserDefinedData { impl_def_id, args, mut nested } = impl_impl_source;
2339+
let ImplSourceUserDefinedData { impl_def_id, args, nested } = impl_impl_source;
23412340
let assoc_item_id = obligation.predicate.def_id;
23422341
let trait_def_id = tcx.trait_id_of_impl(impl_def_id).unwrap();
23432342

@@ -2384,62 +2383,10 @@ fn confirm_impl_candidate<'cx, 'tcx>(
23842383
);
23852384
Progress { term: err.into(), obligations: nested }
23862385
} else {
2387-
assoc_ty_own_obligations(selcx, obligation, &mut nested);
23882386
Progress { term: term.instantiate(tcx, args), obligations: nested }
23892387
}
23902388
}
23912389

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-
24432390
pub(crate) trait ProjectionCacheKeyExt<'cx, 'tcx>: Sized {
24442391
fn from_poly_projection_predicate(
24452392
selcx: &mut SelectionContext<'cx, 'tcx>,

0 commit comments

Comments
 (0)