Skip to content

Commit 8936093

Browse files
committed
Fix proc macro crate encoding.
1 parent 4eb0bbd commit 8936093

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

compiler/rustc_metadata/src/rmeta/encoder.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -1613,12 +1613,19 @@ impl EncodeContext<'a, 'tcx> {
16131613
let tcx = self.tcx;
16141614
let hir = tcx.hir();
16151615

1616-
record!(self.tables.span[LOCAL_CRATE.as_def_id()] <- hir.span(hir::CRATE_HIR_ID));
1617-
16181616
let proc_macro_decls_static = tcx.proc_macro_decls_static(LOCAL_CRATE).unwrap().index;
16191617
let stability = tcx.lookup_stability(DefId::local(CRATE_DEF_INDEX)).copied();
16201618
let macros = self.lazy(hir.krate().proc_macros.iter().map(|p| p.owner.local_def_index));
16211619

1620+
record!(self.tables.def_kind[LOCAL_CRATE.as_def_id()] <- DefKind::Mod);
1621+
record!(self.tables.span[LOCAL_CRATE.as_def_id()] <- tcx.def_span(LOCAL_CRATE.as_def_id()));
1622+
record!(self.tables.attributes[LOCAL_CRATE.as_def_id()] <- tcx.get_attrs(LOCAL_CRATE.as_def_id()));
1623+
record!(self.tables.visibility[LOCAL_CRATE.as_def_id()] <- tcx.visibility(LOCAL_CRATE.as_def_id()));
1624+
if let Some(stability) = stability {
1625+
record!(self.tables.stability[LOCAL_CRATE.as_def_id()] <- stability);
1626+
}
1627+
self.encode_deprecation(LOCAL_CRATE.as_def_id());
1628+
16221629
// Normally, this information is encoded when we walk the items
16231630
// defined in this crate. However, we skip doing that for proc-macro crates,
16241631
// so we manually encode just the information that we need

0 commit comments

Comments
 (0)