diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-04-01 14:49:58 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-04-01 16:07:23 +1100 |
| commit | ec10833609aa63327437aabfaedfbe8a0edcc4d9 (patch) | |
| tree | 84f9ce4b9ce574191c76321b5c65940dc03e0107 /compiler/rustc_builtin_macros/src | |
| parent | df247968f267d30fb8b048c21f595f2293d8ff62 (diff) | |
| download | rust-ec10833609aa63327437aabfaedfbe8a0edcc4d9.tar.gz rust-ec10833609aa63327437aabfaedfbe8a0edcc4d9.zip | |
Address review comments.
Diffstat (limited to 'compiler/rustc_builtin_macros/src')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/proc_macro_harness.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_builtin_macros/src/proc_macro_harness.rs b/compiler/rustc_builtin_macros/src/proc_macro_harness.rs index 7c25f26895c..8862965c053 100644 --- a/compiler/rustc_builtin_macros/src/proc_macro_harness.rs +++ b/compiler/rustc_builtin_macros/src/proc_macro_harness.rs @@ -213,10 +213,8 @@ impl<'a> Visitor<'a> for CollectProcMacros<'a> { return; }; - // First up, make sure we're checking a bare function. If we're not then - // we're just not interested in this item. - // - // If we find one, try to locate a `#[proc_macro_derive]` attribute on it. + // Make sure we're checking a bare function. If we're not then we're + // just not interested any further in this item. let fn_ident = if let ast::ItemKind::Fn(fn_) = &item.kind { fn_.ident } else { @@ -243,6 +241,7 @@ impl<'a> Visitor<'a> for CollectProcMacros<'a> { return; } + // Try to locate a `#[proc_macro_derive]` attribute. if attr.has_name(sym::proc_macro_derive) { self.collect_custom_derive(item, fn_ident, attr); } else if attr.has_name(sym::proc_macro_attribute) { |
