use default binding mode in match clauses

This commit is contained in:
Cedric 2019-06-08 13:29:43 +02:00
parent 4123b5d796
commit dd442a1fcf
2 changed files with 10 additions and 10 deletions

View File

@ -34,7 +34,7 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt<'_>,
token_tree: &[TokenTree])
-> Box<dyn MacResult+'cx> {
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<dyn MacResult+'cx> {
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!()
};

View File

@ -434,15 +434,15 @@ fn string_to_tts_macro () {
if name_macro_rules == sym::macro_rules && name_zip.as_str() == "zip" => {
let tts = &macro_tts.trees().collect::<Vec<_>>();
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::<Vec<_>>();
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::<Vec<_>>();
match tts {
&[
[
TokenTree::Token(Token { kind: token::Dollar, .. }),
TokenTree::Token(Token { kind: token::Ident(name, false), .. }),
]