1
Fork 0

Rollup merge of #56820 - ljedrz:format_tweaks, r=alexcrichton

format-related tweaks

- remove an unreachable condition
- inline one-liners related to `parse_expr` (called in succession)
- refactor `report_invalid_references`
- refactor `verify_arg_type`
- minor stylistic improvements
This commit is contained in:
Pietro Albini 2018-12-19 11:47:09 +01:00 committed by GitHub
commit 29aa466508
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 81 deletions

View file

@ -3062,6 +3062,7 @@ impl<'a> Parser<'a> {
///
/// This parses an expression accounting for associativity and precedence of the operators in
/// the expression.
#[inline]
fn parse_assoc_expr(&mut self,
already_parsed_attrs: Option<ThinVec<Attribute>>)
-> PResult<'a, P<Expr>> {
@ -3722,6 +3723,7 @@ impl<'a> Parser<'a> {
}
/// Parse an expression
#[inline]
pub fn parse_expr(&mut self) -> PResult<'a, P<Expr>> {
self.parse_expr_res(Restrictions::empty(), None)
}
@ -3741,6 +3743,7 @@ impl<'a> Parser<'a> {
}
/// Parse an expression, subject to the given restrictions
#[inline]
fn parse_expr_res(&mut self, r: Restrictions,
already_parsed_attrs: Option<ThinVec<Attribute>>)
-> PResult<'a, P<Expr>> {