Skip to content

Commit ca3f622

Browse files
Add missing documentation
1 parent dfb8d9a commit ca3f622

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/librustdoc/clean/inline.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ pub(crate) fn item_relative_path(tcx: TyCtxt<'_>, def_id: DefId) -> Vec<Symbol>
227227
tcx.def_path(def_id).data.into_iter().filter_map(|elem| elem.data.get_opt_name()).collect()
228228
}
229229

230+
/// Get the path to an item in a URL sense: we use it to generate the URL to the actual item.
231+
///
232+
/// In particular: we handle macro differently: if it's not a macro 2.0 oe a built-in macro, then
233+
/// it is generated at the top-level of the crate and its path will be `[crate_name, macro_name]`.
230234
pub(crate) fn get_item_path(tcx: TyCtxt<'_>, def_id: DefId, kind: ItemType) -> Vec<Symbol> {
231235
let crate_name = tcx.crate_name(def_id.krate);
232236
let relative = item_relative_path(tcx, def_id);

src/librustdoc/html/format.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,8 @@ fn generate_macro_def_id_path(
410410
Ok((url, item_type, fqp))
411411
}
412412

413+
/// If the function succeeded, it will return the full URL to the item, its type and a `Vec`
414+
/// representing its `use` path.
413415
fn generate_item_def_id_path(
414416
mut def_id: DefId,
415417
original_def_id: DefId,

0 commit comments

Comments
 (0)