Don't try to label ObligationCauseCode::CompareImplItem for an RPITIT, since it has no name

This commit is contained in:
Michael Goulet 2024-07-05 21:59:07 -04:00
parent 8a8ad3433e
commit d6276b37ea
4 changed files with 228 additions and 24 deletions

View file

@ -3472,6 +3472,10 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
)
});
}
// Suppress `compare_type_predicate_entailment` errors for RPITITs, since they
// should be implied by the parent method.
ObligationCauseCode::CompareImplItem { trait_item_def_id, .. }
if tcx.is_impl_trait_in_trait(trait_item_def_id) => {}
ObligationCauseCode::CompareImplItem { trait_item_def_id, kind, .. } => {
let item_name = tcx.item_name(trait_item_def_id);
let msg = format!(