diff options
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/specialize/mod.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/specialize/mod.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs index b329739609c..f5bc6c3ad2c 100644 --- a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs @@ -39,6 +39,7 @@ pub struct OverlapError<'tcx> { pub self_ty: Option<Ty<'tcx>>, pub intercrate_ambiguity_causes: FxIndexSet<IntercrateAmbiguityCause<'tcx>>, pub involves_placeholder: bool, + pub overflowing_predicates: Vec<ty::Predicate<'tcx>>, } /// Given the generic parameters for the requested impl, translate it to the generic parameters @@ -435,6 +436,14 @@ fn report_conflicting_impls<'tcx>( if overlap.involves_placeholder { coherence::add_placeholder_note(err); } + + if !overlap.overflowing_predicates.is_empty() { + coherence::suggest_increasing_recursion_limit( + tcx, + err, + &overlap.overflowing_predicates, + ); + } } let msg = DelayDm(|| { |
