+ MacroDirectiveKind::Attr { ast_id, mod_item, attr } => {
+ if let Some(ident) = ast_id.path.as_ident() {
+ if let Some(helpers) = self.derive_helpers_in_scope.get(&ast_id.ast_id) {
+ if helpers.contains(ident) {
+ cov_mark::hit!(resolved_derive_helper);
+
+ // Resolved to derive helper. Collect the item's attributes again,
+ // starting after the derive helper.
+ let file_id = self.def_map[directive.module_id]
+ .definition_source(self.db)
+ .file_id;
+ let item_tree = self.db.file_item_tree(file_id);
+ let mod_dir = self.mod_dirs[&directive.module_id].clone();
+ self.ignore_attrs_on.insert(InFile::new(file_id, *mod_item), *attr);
+ ModCollector {
+ def_collector: &mut *self,
+ macro_depth: directive.depth,
+ module_id: directive.module_id,
+ file_id,
+ item_tree: &item_tree,
+ mod_dir,
+ }
+ .collect(&[*mod_item]);
+
+ // Remove the original directive since we resolved it.
+ return false;
+ }
+ }
+ }
+
+ // Not resolved to a derive helper, so try to resolve as a macro.
+ // FIXME: not yet :)