Skip to content

Commit 699be41

Browse files
committed
Simplify an error handling in the parser
1 parent 78a19d9 commit 699be41

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4886,6 +4886,8 @@ impl<'a> Parser<'a> {
48864886
bounds.push(RegionTyParamBound(self.expect_lifetime()));
48874887
if has_parens {
48884888
self.expect(&token::CloseDelim(token::Paren))?;
4889+
self.span_err(self.prev_span,
4890+
"parenthesized lifetime bounds are not supported");
48894891
}
48904892
} else {
48914893
let lifetime_defs = self.parse_late_bound_lifetime_defs()?;
@@ -4901,12 +4903,6 @@ impl<'a> Parser<'a> {
49014903
};
49024904
bounds.push(TraitTyParamBound(poly_trait, modifier));
49034905
}
4904-
if has_parens {
4905-
if let Some(&RegionTyParamBound(..)) = bounds.last() {
4906-
self.span_err(self.prev_span,
4907-
"parenthesized lifetime bounds are not supported");
4908-
}
4909-
}
49104906
} else {
49114907
break
49124908
}

0 commit comments

Comments
 (0)