diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-11-23 20:32:37 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-23 20:32:37 +0530 |
| commit | c03026a7c61832d8ed3349800dfd4fb446e51dc2 (patch) | |
| tree | 330c198ba63b1567d973468a0e8163d6def59eb8 /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 0a791381c35e5af276831a566c18d14f46a41b3a (diff) | |
| parent | b97ec3924dc5a3718af8b2936fd6cc356e785832 (diff) | |
| download | rust-c03026a7c61832d8ed3349800dfd4fb446e51dc2.tar.gz rust-c03026a7c61832d8ed3349800dfd4fb446e51dc2.zip | |
Rollup merge of #104721 - WaffleLapkin:deref-harder, r=oli-obk
Remove more `ref` patterns from the compiler r? `@oli-obk` Previous PR: https://github.com/rust-lang/rust/pull/104500
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) |
