Sort of the opposite of https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20do.20I.20get.20the.20module.20that.20an.20Item.20belongs.20to.3F - I have a
rustc_hir::DefId and I want to get a
rustc_hir::Item. Is there a way to do that? In case it helps, I don't need the whole
Item, just the
You can't get the
ItemKind for cross-crate items. Is
tcx.def_kind good enough for what you need?
I think I found it going another way, rustdoc stores an
ImportSource which I think has the
DefId of the item being imported: https://github.com/rust-lang/rust/blob/master/src/librustdoc/clean/types.rs#L1500
HirIds only for the current crate? Or can they be cross-crate?
Only the current crate
Got it, so this is why
resolve_str_path_error only works on local items. Thanks.