1
Fork 0

resolve: Avoid clones of MacroData

And move declarative macro compilation to an earlier point in def collector, which is required for #118188.
This commit is contained in:
Vadim Petrochenkov 2023-11-24 23:39:42 +03:00
parent 0f696e555f
commit ad0770eeee
5 changed files with 52 additions and 55 deletions

View file

@ -240,7 +240,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
{
// The macro is a proc macro derive
if let Some(def_id) = module.expansion.expn_data().macro_def_id {
let ext = self.get_macro_by_def_id(def_id).ext;
let ext = &self.get_macro_by_def_id(def_id).ext;
if ext.builtin_name.is_none()
&& ext.macro_kind() == MacroKind::Derive
&& parent.expansion.outer_expn_is_descendant_of(*ctxt)