rustc_parse
: remove ref
patterns
This commit is contained in:
parent
0f7d81754d
commit
616df0f03b
8 changed files with 39 additions and 39 deletions
|
@ -973,7 +973,7 @@ impl<'a> Parser<'a> {
|
|||
inner_op: &Expr,
|
||||
outer_op: &Spanned<AssocOp>,
|
||||
) -> bool /* advanced the cursor */ {
|
||||
if let ExprKind::Binary(op, ref l1, ref r1) = inner_op.kind {
|
||||
if let ExprKind::Binary(op, l1, r1) = &inner_op.kind {
|
||||
if let ExprKind::Field(_, ident) = l1.kind
|
||||
&& ident.as_str().parse::<i32>().is_err()
|
||||
&& !matches!(r1.kind, ExprKind::Lit(_))
|
||||
|
@ -1079,8 +1079,8 @@ impl<'a> Parser<'a> {
|
|||
|
||||
let mk_err_expr = |this: &Self, span| Ok(Some(this.mk_expr(span, ExprKind::Err)));
|
||||
|
||||
match inner_op.kind {
|
||||
ExprKind::Binary(op, ref l1, ref r1) if op.node.is_comparison() => {
|
||||
match &inner_op.kind {
|
||||
ExprKind::Binary(op, l1, r1) if op.node.is_comparison() => {
|
||||
let mut err = ComparisonOperatorsCannotBeChained {
|
||||
span: vec![op.span, self.prev_token.span],
|
||||
suggest_turbofish: None,
|
||||
|
@ -1237,8 +1237,8 @@ impl<'a> Parser<'a> {
|
|||
let bounds = self.parse_generic_bounds(None)?;
|
||||
let sum_span = ty.span.to(self.prev_token.span);
|
||||
|
||||
let sub = match ty.kind {
|
||||
TyKind::Rptr(ref lifetime, ref mut_ty) => {
|
||||
let sub = match &ty.kind {
|
||||
TyKind::Rptr(lifetime, mut_ty) => {
|
||||
let sum_with_parens = pprust::to_string(|s| {
|
||||
s.s.word("&");
|
||||
s.print_opt_lifetime(lifetime);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue