Auto merge of #37753 - est31:master, r=petrochenkov
Fix empty lifetime list or one with trailing comma being rejected Fixes #37733
This commit is contained in:
commit
876b761010
2 changed files with 18 additions and 3 deletions
|
@ -1902,12 +1902,12 @@ impl<'a> Parser<'a> {
|
|||
if let Some(recv) = followed_by_ty_params {
|
||||
assert!(recv.is_empty());
|
||||
*recv = attrs;
|
||||
} else {
|
||||
debug!("parse_lifetime_defs ret {:?}", res);
|
||||
return Ok(res);
|
||||
} else if !attrs.is_empty() {
|
||||
let msg = "trailing attribute after lifetime parameters";
|
||||
return Err(self.fatal(msg));
|
||||
}
|
||||
debug!("parse_lifetime_defs ret {:?}", res);
|
||||
return Ok(res);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue