Skip to content

Commit 3d4aa89

Browse files
committed
feat(exporter): add a kind on DefIds
Fixes #1163
1 parent a3d7bd0 commit 3d4aa89

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

frontend/exporter/src/types/def_id.rs

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ pub struct DefIdContents {
5454
/// indexes unless you cannot do otherwise.
5555
pub index: (u32, u32),
5656
pub is_local: bool,
57+
58+
/// The kind of definition this `DefId` points to.
59+
#[cfg(not(feature = "extract_names_mode"))]
60+
pub kind: crate::DefKind,
5761
}
5862

5963
#[cfg(feature = "rustc")]
@@ -140,6 +144,8 @@ pub(crate) fn translate_def_id<'tcx, S: BaseState<'tcx>>(s: &S, def_id: RDefId)
140144
rustc_hir::def_id::DefIndex::as_u32(def_id.index),
141145
),
142146
is_local: def_id.is_local(),
147+
#[cfg(not(feature = "extract_names_mode"))]
148+
kind: tcx.def_kind(def_id).sinto(s),
143149
};
144150
let contents =
145151
s.with_global_cache(|cache| id_table::Node::new(contents, &mut cache.id_table_session));

0 commit comments

Comments
 (0)