1
Fork 0

Avoid cycles from projection bounds

Only check the own predicates of associated types when confirming
projection candidates.
Also consider implied bounds when comparing trait and impl methods.
This commit is contained in:
Matthew Jasper 2020-07-25 13:41:53 +01:00
parent 596d6c4b3b
commit 0dfa6ff3be
11 changed files with 122 additions and 85 deletions

View file

@ -328,7 +328,7 @@ fn compare_predicate_entailment<'tcx>(
// Finally, resolve all regions. This catches wily misuses of
// lifetime parameters.
let fcx = FnCtxt::new(&inh, param_env, impl_m_hir_id);
fcx.regionck_item(impl_m_hir_id, impl_m_span, &[]);
fcx.regionck_item(impl_m_hir_id, impl_m_span, trait_sig.inputs_and_output);
Ok(())
})