Function rustdoc::json::conversions::id_from_item_inner

source ·
pub(crate) fn id_from_item_inner(
    item_id: ItemId,
    tcx: TyCtxt<'_>,
    name: Option<Symbol>,
    extra: Option<&Id>,
) -> Id
Expand description

It generates an ID as follows:

CRATE_ID:ITEM_ID[:NAME_ID][-EXTRA]:

  • If there is no name, NAME_ID is not generated.

  • If there is no extra, EXTRA is not generated.

  • name is the item’s name if available (it’s not for impl blocks for example).

  • extra is used for reexports: it contains the ID of the reexported item. It is used to allow to have items with the same name but different types to both appear in the generated JSON.