From dd442a1fcfba98be5454c2ca6f56bce098e458ed Mon Sep 17 00:00:00 2001 From: Cedric Date: Sat, 8 Jun 2019 13:29:43 +0200 Subject: [PATCH] use default binding mode in match clauses --- src/libsyntax/diagnostics/plugin.rs | 10 +++++----- src/libsyntax/parse/mod.rs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/libsyntax/diagnostics/plugin.rs b/src/libsyntax/diagnostics/plugin.rs index b4cf24f5ac5..98351048c35 100644 --- a/src/libsyntax/diagnostics/plugin.rs +++ b/src/libsyntax/diagnostics/plugin.rs @@ -34,7 +34,7 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt<'_>, token_tree: &[TokenTree]) -> Box { let code = match token_tree { - &[ + [ TokenTree::Token(Token { kind: token::Ident(code, _), .. }) ] => code, _ => unreachable!() @@ -69,17 +69,17 @@ pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt<'_>, token_tree: &[TokenTree]) -> Box { let (code, description) = match token_tree { - &[ + [ TokenTree::Token(Token { kind: token::Ident(code, _), .. }) ] => { - (code, None) + (*code, None) }, - &[ + [ TokenTree::Token(Token { kind: token::Ident(code, _), .. }), TokenTree::Token(Token { kind: token::Comma, .. }), TokenTree::Token(Token { kind: token::Literal(token::Lit { symbol, .. }), ..}) ] => { - (code, Some(symbol)) + (*code, Some(*symbol)) }, _ => unreachable!() }; diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 025972d8ca7..b912bf8295a 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -434,15 +434,15 @@ fn string_to_tts_macro () { if name_macro_rules == sym::macro_rules && name_zip.as_str() == "zip" => { let tts = ¯o_tts.trees().collect::>(); match tts { - &[ - TokenTree::Delimited(_, first_delim, ref first_tts), + [ + TokenTree::Delimited(_, first_delim, first_tts), TokenTree::Token(Token { kind: token::FatArrow, .. }), - TokenTree::Delimited(_, second_delim, ref second_tts), + TokenTree::Delimited(_, second_delim, second_tts), ] if macro_delim == token::Paren => { let tts = &first_tts.trees().collect::>(); match tts { - &[ + [ TokenTree::Token(Token { kind: token::Dollar, .. }), TokenTree::Token(Token { kind: token::Ident(name, false), .. }), ] @@ -451,7 +451,7 @@ fn string_to_tts_macro () { } let tts = &second_tts.trees().collect::>(); match tts { - &[ + [ TokenTree::Token(Token { kind: token::Dollar, .. }), TokenTree::Token(Token { kind: token::Ident(name, false), .. }), ]