diff options
| author | bors <bors@rust-lang.org> | 2022-11-23 16:29:17 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-11-23 16:29:17 +0000 |
| commit | d121aa3b5584eb919a4aaf64dbae0ea1e8e30231 (patch) | |
| tree | 461296940a2cde7aafa71a03a1e2e9cb274af082 /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 80b3c6dbde3ff89a44f8eaa63e08054398b30ecd (diff) | |
| parent | 5d7b68c82bf4e6b4ba1171b01da2d11a0886f751 (diff) | |
| download | rust-d121aa3b5584eb919a4aaf64dbae0ea1e8e30231.tar.gz rust-d121aa3b5584eb919a4aaf64dbae0ea1e8e30231.zip | |
Auto merge of #104776 - Dylan-DPC:rollup-rf4c2u0, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #104269 (Fix hang in where-clause suggestion with `predicate_can_apply`) - #104286 (copy doc output files by format) - #104509 (Use obligation ctxt instead of dyn TraitEngine) - #104721 (Remove more `ref` patterns from the compiler) - #104744 (rustdoc: give struct fields CSS `display: block`) - #104751 (Fix an ICE parsing a malformed attribute.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index ba73fbd3e12..dc914f5ea64 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -414,7 +414,7 @@ impl<'a> Parser<'a> { self.sess.ambiguous_block_expr_parse.borrow_mut().insert(sp, lhs.span); false } - (true, Some(ref op)) if !op.can_continue_expr_unambiguously() => false, + (true, Some(op)) if !op.can_continue_expr_unambiguously() => false, (true, Some(_)) => { self.error_found_expr_would_be_stmt(lhs); true @@ -1728,7 +1728,7 @@ impl<'a> Parser<'a> { || !self.restrictions.contains(Restrictions::NO_STRUCT_LITERAL) { let expr = self.parse_expr_opt()?; - if let Some(ref expr) = expr { + if let Some(expr) = &expr { if label.is_some() && matches!( expr.kind, @@ -2590,8 +2590,8 @@ impl<'a> Parser<'a> { // Used to check the `let_chains` and `if_let_guard` features mostly by scanning // `&&` tokens. fn check_let_expr(expr: &Expr) -> (bool, bool) { - match expr.kind { - ExprKind::Binary(BinOp { node: BinOpKind::And, .. }, ref lhs, ref rhs) => { + match &expr.kind { + ExprKind::Binary(BinOp { node: BinOpKind::And, .. }, lhs, rhs) => { let lhs_rslt = check_let_expr(lhs); let rhs_rslt = check_let_expr(rhs); (lhs_rslt.0 || rhs_rslt.0, false) |
