1
Fork 0

Don't suggest constraining unstable associated types

This commit is contained in:
Michael Goulet 2025-02-25 20:01:48 +00:00
parent c51b9b6d52
commit 9313580e2a
3 changed files with 33 additions and 1 deletions

View file

@ -136,7 +136,10 @@ pub fn suggest_restriction<'tcx, G: EmissionGuarantee>(
) {
if hir_generics.where_clause_span.from_expansion()
|| hir_generics.where_clause_span.desugaring_kind().is_some()
|| projection.is_some_and(|projection| tcx.is_impl_trait_in_trait(projection.def_id))
|| projection.is_some_and(|projection| {
tcx.is_impl_trait_in_trait(projection.def_id)
|| tcx.lookup_stability(projection.def_id).is_some_and(|stab| stab.is_unstable())
})
{
return;
}