From d6276b37eace2e49794679fb927b6b499e00a064 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Fri, 5 Jul 2024 21:59:07 -0400 Subject: Don't try to label ObligationCauseCode::CompareImplItem for an RPITIT, since it has no name --- .../rustc_trait_selection/src/traits/error_reporting/suggestions.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/rustc_trait_selection/src') diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index a0a8e5963f1..52edffce614 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -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!( -- cgit 1.4.1-3-g733a5