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:
parent
ed6468da16
commit
c751961d29
6 changed files with 91 additions and 12 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue