Skip to content

Commit

Permalink
feat(exporter): add a kind on DefIds
Browse files Browse the repository at this point in the history
Fixes #1163
  • Loading branch information
W95Psp committed Dec 18, 2024
1 parent 555aefd commit b74cabd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/exporter/src/types/def_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ pub struct DefIdContents {
/// indexes unless you cannot do otherwise.
pub index: (u32, u32),
pub is_local: bool,

/// The kind of definition this `DefId` points to.
#[cfg(not(feature = "extract_names_mode"))]
pub kind: crate::DefKind,
}

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

0 comments on commit b74cabd

Please sign in to comment.