1
Fork 0

Rollup merge of #131375 - klensy:clone_on_ref_ptr, r=cjgillot

compiler: apply clippy::clone_on_ref_ptr for CI

Apply lint https://rust-lang.github.io/rust-clippy/master/index.html#/clone_on_ref_ptr for compiler, also see https://github.com/rust-lang/rust/pull/131225#discussion_r1790109443.

Some Arc's can be misplaced with Lrc's, sorry.

https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/enable.20more.20clippy.20lints.20for.20compiler.20.28and.5Cor.20std.29
This commit is contained in:
Jubilee 2024-10-29 03:11:39 -07:00 committed by GitHub
commit 5d0f52efa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 100 additions and 92 deletions

View file

@ -1694,9 +1694,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
fn dummy_ext(&self, macro_kind: MacroKind) -> Lrc<SyntaxExtension> {
match macro_kind {
MacroKind::Bang => self.dummy_ext_bang.clone(),
MacroKind::Derive => self.dummy_ext_derive.clone(),
MacroKind::Attr => self.non_macro_attr.ext.clone(),
MacroKind::Bang => Lrc::clone(&self.dummy_ext_bang),
MacroKind::Derive => Lrc::clone(&self.dummy_ext_derive),
MacroKind::Attr => Lrc::clone(&self.non_macro_attr.ext),
}
}

View file

@ -826,7 +826,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
}
_ => None,
},
None => self.get_macro(res).map(|macro_data| macro_data.ext.clone()),
None => self.get_macro(res).map(|macro_data| Lrc::clone(&macro_data.ext)),
};
Ok((ext, res))
}