Skip to content

Commit d94b305

Browse files
committed
Call Arc::clone rather than .clone() to make clippy happy
1 parent 82d8890 commit d94b305

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

compiler/rustc_expand/src/mbe/macro_rules.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -628,11 +628,10 @@ pub fn compile_declarative_macro(
628628
// Return the number of rules for unused rule linting, if this is a local macro.
629629
let nrules = if is_defined_in_current_crate(node_id) { rules.len() } else { 0 };
630630

631-
let expander =
632-
Arc::new(MacroRulesMacroExpander { name: ident, span, node_id, transparency, rules });
631+
let exp = Arc::new(MacroRulesMacroExpander { name: ident, span, node_id, transparency, rules });
633632
let opt_attr_ext =
634-
has_attr_rules.then(|| Arc::new(mk_syn_ext(SyntaxExtensionKind::Attr(expander.clone()))));
635-
(mk_bang_ext(expander), opt_attr_ext, nrules)
633+
has_attr_rules.then(|| Arc::new(mk_syn_ext(SyntaxExtensionKind::Attr(Arc::clone(exp)))));
634+
(mk_bang_ext(exp), opt_attr_ext, nrules)
636635
}
637636

638637
fn check_no_eof(sess: &Session, p: &Parser<'_>, msg: &'static str) -> Option<ErrorGuaranteed> {

0 commit comments

Comments
 (0)