Move lifetimes before the *first* type argument

This commit is contained in:
Esteban Küber 2018-11-25 12:46:42 -08:00
parent 79ee8f329d
commit 234d043d18
2 changed files with 5 additions and 3 deletions

View File

@ -5229,7 +5229,9 @@ fn parse_trait_item_assoc_ty(&mut self)
} else if self.check_ident() {
// Parse type parameter.
params.push(self.parse_ty_param(attrs)?);
seen_ty_param = Some(self.prev_span);
if seen_ty_param.is_none() {
seen_ty_param = Some(self.prev_span);
}
} else {
// Check for trailing attributes and stop parsing.
if !attrs.is_empty() {

View File

@ -25,8 +25,8 @@ LL | struct C<T, U, 'a> {
| ^^
help: move the lifetime parameter prior to the first type parameter
|
LL | struct C<T, 'a, U> {
| ^^^ --
LL | struct C<'a, T, U> {
| ^^^ --
error: aborting due to 3 previous errors