about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-07-05 21:59:07 -0400
committerMichael Goulet <michael@errs.io>2024-07-06 15:20:37 -0400
commitd6276b37eace2e49794679fb927b6b499e00a064 (patch)
tree3b856950b34a62374cba9e45432b8390b378db8f /compiler/rustc_trait_selection
parent8a8ad3433e4168f54ac1364f85da694be9eeca7c (diff)
downloadrust-d6276b37eace2e49794679fb927b6b499e00a064.tar.gz
rust-d6276b37eace2e49794679fb927b6b499e00a064.zip
Don't try to label ObligationCauseCode::CompareImplItem for an RPITIT, since it has no name
Diffstat (limited to 'compiler/rustc_trait_selection')
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs4
1 files changed, 4 insertions, 0 deletions
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!(