Skip to content

Commit

Permalink
use default binding mode in match clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
Electron-libre committed Jun 8, 2019
1 parent 4123b5d commit dd442a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/libsyntax/diagnostics/plugin.rs
Expand Up @@ -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!()
Expand Down Expand Up @@ -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!()
};
Expand Down
10 changes: 5 additions & 5 deletions src/libsyntax/parse/mod.rs
Expand Up @@ -434,15 +434,15 @@ mod tests {
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), .. }),
]
Expand All @@ -451,7 +451,7 @@ mod tests {
}
let tts = &second_tts.trees().collect::<Vec<_>>();
match tts {
&[
[
TokenTree::Token(Token { kind: token::Dollar, .. }),
TokenTree::Token(Token { kind: token::Ident(name, false), .. }),
]
Expand Down

0 comments on commit dd442a1

Please sign in to comment.