Function rustdoc::clean::get_all_import_attributes
source · fn get_all_import_attributes<'hir>(
item: &Item<'hir>,
tcx: TyCtxt<'hir>,
target_hir_id: HirId,
attributes: &mut Vec<Attribute>
)
Expand description
Because a Use
item directly links to the imported item, we need to manually go through each
import one by one. To do so, we go to the parent item and look for the Ident
into it. Then,
if we found the “end item” (the imported one), we stop there because we don’t need its
documentation. Otherwise, we repeat the same operation until we find the “end item”.