Do not suggest impl traits as type arguments
This commit is contained in:
parent
3354a44d2f
commit
14e92d7116
7 changed files with 71 additions and 16 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue