X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_expand%2Fsrc%2Fmbe%2Fmacro_check.rs;h=5be134f4e664c80c189cefab7d41baa380b41045;hb=45446824e3226c9270a8eb6e3554edbca5187fd2;hp=0b8847f827df1aa6ad9b8a056ccadba7d03ed9aa;hpb=6702f20ca7a117e249d31c96f2c5f48f1bb4eaaa;p=rust.git diff --git a/compiler/rustc_expand/src/mbe/macro_check.rs b/compiler/rustc_expand/src/mbe/macro_check.rs index 0b8847f827d..5be134f4e66 100644 --- a/compiler/rustc_expand/src/mbe/macro_check.rs +++ b/compiler/rustc_expand/src/mbe/macro_check.rs @@ -151,9 +151,9 @@ impl<'a, T> Iterator for &'a Stack<'a, T> { // Iterates from top to bottom of the stack. fn next(&mut self) -> Option<&'a T> { - match *self { + match self { Stack::Empty => None, - Stack::Push { ref top, ref prev } => { + Stack::Push { top, prev } => { *self = prev; Some(top) } @@ -437,8 +437,8 @@ fn check_nested_occurrences( // We check that the meta-variable is correctly used. check_occurrences(sess, node_id, tt, macros, binders, ops, valid); } - (NestedMacroState::MacroRulesNotName, &TokenTree::Delimited(_, ref del)) - | (NestedMacroState::MacroName, &TokenTree::Delimited(_, ref del)) + (NestedMacroState::MacroRulesNotName, TokenTree::Delimited(_, del)) + | (NestedMacroState::MacroName, TokenTree::Delimited(_, del)) if del.delim == Delimiter::Brace => { let macro_rules = state == NestedMacroState::MacroRulesNotName; @@ -497,7 +497,7 @@ fn check_nested_occurrences( valid, ); } - (_, ref tt) => { + (_, tt) => { state = NestedMacroState::Empty; check_occurrences(sess, node_id, tt, macros, binders, ops, valid); }