I managed to get a DefId for it but I'm not sure where to go from there.
tcx.parent(def_id)
using the DefIdTree
trait will get the parent item of a def_id. For items this will be the parent module.
If you may have an associated item or something that's not an item, you'll have to call parent
in a loop until tcx.def_kind(def_id)
is DefKind::Mod
.
If the item is guaranteed to be in the current crate, then parent_module
on the HirId
would be easiest.
If the item is guaranteed to be in the current crate, then parent_module on the HirId would be easiest.
This is actually only for cross-crate re-exports. tcx.parent()
looks like what I need, thank you!