assoc_items.iter().copied(),
tree_id,
container,
- 100,
);
let attribute_calls =
assoc_items: impl Iterator<Item = AssocItem>,
tree_id: item_tree::TreeId,
container: ItemContainerId,
- limit: usize,
) {
- if limit == 0 {
- return;
- }
-
let item_tree = tree_id.item_tree(db);
let crate_graph = db.crate_graph();
let cfg_options = &crate_graph[module.krate].cfg_options;
{
attr_calls.push((ast_id, call_id));
let res = expander.enter_expand_id(db, call_id);
- collect_macro_items(db, items, attr_calls, module, expander, container, limit, res);
+ collect_macro_items(db, items, attr_calls, module, expander, container, res);
continue 'items;
}
}
let res = expander.enter_expand(db, call);
if let Ok(res) = res {
- collect_macro_items(
- db, items, attr_calls, module, expander, container, limit, res,
- );
+ collect_macro_items(db, items, attr_calls, module, expander, container, res);
}
}
}
module: ModuleId,
expander: &mut Expander,
container: ItemContainerId,
- limit: usize,
res: ExpandResult<Option<(Mark, ast::MacroItems)>>,
) {
if let Some((mark, mac)) = res.value {
let tree_id = item_tree::TreeId::new(src.file_id, None);
let item_tree = tree_id.item_tree(db);
let iter = item_tree.top_level_items().iter().filter_map(ModItem::as_assoc_item);
- collect_items(db, items, attr_calls, module, expander, iter, tree_id, container, limit - 1);
+ collect_items(db, items, attr_calls, module, expander, iter, tree_id, container);
expander.exit(db, mark);
}