1
Fork 0

Auto merge of #86338 - JohnTitor:issue-86162, r=estebank

Do not suggest impl traits as type arguments

Fixes #86162
This commit is contained in:
bors 2021-08-03 13:23:31 +00:00
commit d5fd37f00f
8 changed files with 72 additions and 27 deletions

View file

@ -647,17 +647,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
return false;
}
let impl_trait = generics.params.iter().any(|param| {
matches!(
param.kind,
ty::GenericParamDefKind::Type {
synthetic: Some(
hir::SyntheticTyParamKind::ImplTrait | hir::SyntheticTyParamKind::FromAttr,
),
..
}
)
});
let impl_trait = generics.has_impl_trait();
if impl_trait {
let spans = seg