diagnostics: exclude indirect private deps from trait impl suggest

Fixes #88696
This commit is contained in:
Michael Howell 2023-05-01 12:05:20 -07:00
parent e36020cdb3
commit 674a3d5c1c
4 changed files with 48 additions and 1 deletions

View file

@ -1775,6 +1775,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|| !trait_pred
.skip_binder()
.is_constness_satisfied_by(self.tcx.constness(def_id))
|| !self.tcx.is_user_visible_dep(def_id.krate)
{
return None;
}