Add note on panic behavior
This commit is contained in:
parent
6f6afae41a
commit
f7f14f6f0b
@ -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<DefId> {
|
||||
if def_id.is_top_level_module() {
|
||||
// The crate root has no parent. Use it as the root instead.
|
||||
|
Loading…
x
Reference in New Issue
Block a user