From f7f14f6f0b6cde5ab9f5b644d0939fb1232b9c15 Mon Sep 17 00:00:00 2001 From: Camelid Date: Wed, 30 Dec 2020 17:39:03 -0800 Subject: [PATCH] Add note on panic behavior --- src/librustdoc/clean/utils.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs index 4009a42955f..17f12d0a82f 100644 --- a/src/librustdoc/clean/utils.rs +++ b/src/librustdoc/clean/utils.rs @@ -626,6 +626,8 @@ where } /// Find the nearest parent module of a [`DefId`]. +/// +/// **Panics if the item it belongs to [is fake][Item::is_fake].** crate fn find_nearest_parent_module(tcx: TyCtxt<'_>, def_id: DefId) -> Option { if def_id.is_top_level_module() { // The crate root has no parent. Use it as the root instead.