1
Fork 0

Extend support of _ in type parameters

- Account for `impl Trait<_>`.
 - Provide a reasonable `Span` for empty `Generics` in `impl`s.
 - Account for `fn foo<_>(_: _) {}` to suggest `fn foo<T>(_: T) {}`.
 - Fix #67995.
This commit is contained in:
Esteban Küber 2020-01-09 13:46:37 -08:00
parent ed6468da16
commit c751961d29
6 changed files with 91 additions and 12 deletions

View file

@ -156,7 +156,7 @@ impl<'a> Parser<'a> {
self.expect_gt()?;
(params, span_lo.to(self.prev_span))
} else {
(vec![], self.prev_span.between(self.token.span))
(vec![], self.prev_span.shrink_to_hi())
};
Ok(ast::Generics {
params,