Simplify an error handling in the parser
This commit is contained in:
parent
78a19d9b88
commit
699be41809
1 changed files with 2 additions and 6 deletions
|
@ -4886,6 +4886,8 @@ impl<'a> Parser<'a> {
|
|||
bounds.push(RegionTyParamBound(self.expect_lifetime()));
|
||||
if has_parens {
|
||||
self.expect(&token::CloseDelim(token::Paren))?;
|
||||
self.span_err(self.prev_span,
|
||||
"parenthesized lifetime bounds are not supported");
|
||||
}
|
||||
} else {
|
||||
let lifetime_defs = self.parse_late_bound_lifetime_defs()?;
|
||||
|
@ -4901,12 +4903,6 @@ impl<'a> Parser<'a> {
|
|||
};
|
||||
bounds.push(TraitTyParamBound(poly_trait, modifier));
|
||||
}
|
||||
if has_parens {
|
||||
if let Some(&RegionTyParamBound(..)) = bounds.last() {
|
||||
self.span_err(self.prev_span,
|
||||
"parenthesized lifetime bounds are not supported");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue