1
Fork 0

Don't suggest unnameable generic arguments

This commit is contained in:
León Orell Valerian Liehr 2022-07-22 02:28:03 +02:00
parent af7ab34470
commit c98399f5eb
12 changed files with 90 additions and 22 deletions

View file

@ -378,7 +378,7 @@ fn suggest_restriction<'tcx>(
replace_ty: ty::ParamTy::new(generics.count() as u32, Symbol::intern(&type_param_name))
.to_ty(tcx),
});
if !trait_pred.is_suggestable(tcx) {
if !trait_pred.is_suggestable(tcx, false) {
return;
}
// We know we have an `impl Trait` that doesn't satisfy a required projection.
@ -417,7 +417,7 @@ fn suggest_restriction<'tcx>(
Applicability::MaybeIncorrect,
);
} else {
if !trait_pred.is_suggestable(tcx) {
if !trait_pred.is_suggestable(tcx, false) {
return;
}
// Trivial case: `T` needs an extra bound: `T: Bound`.
@ -586,7 +586,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
// else in the predicate.
if !trait_pred.skip_binder().trait_ref.substs[1..]
.iter()
.all(|g| g.is_suggestable(self.tcx))
.all(|g| g.is_suggestable(self.tcx, false))
{
return;
}