Do not suggest impl traits as type arguments

This commit is contained in:
Yuki Okushi 2021-06-16 06:32:22 +09:00
parent 3354a44d2f
commit 14e92d7116
No known key found for this signature in database
GPG key ID: DABA5B072961C18A
7 changed files with 71 additions and 16 deletions

View file

@ -1603,6 +1603,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
let generics = self.tcx.generics_of(*def_id);
if generics.params.iter().any(|p| p.name != kw::SelfUpper)
&& !snippet.ends_with('>')
&& !generics.has_impl_trait()
{
// FIXME: To avoid spurious suggestions in functions where type arguments
// where already supplied, we check the snippet to make sure it doesn't