Skip to content

Commit 1a34cbc

Browse files
committed
Encode exported symbols last
1 parent 6cd0dca commit 1a34cbc

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/librustc_metadata/rmeta/encoder.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,12 +467,6 @@ impl<'tcx> EncodeContext<'tcx> {
467467
let impls = self.encode_impls();
468468
let impl_bytes = self.position() - i;
469469

470-
// Encode exported symbols info.
471-
i = self.position();
472-
let exported_symbols = self.tcx.exported_symbols(LOCAL_CRATE);
473-
let exported_symbols = self.encode_exported_symbols(&exported_symbols);
474-
let exported_symbols_bytes = self.position() - i;
475-
476470
let tcx = self.tcx;
477471

478472
// Encode the items.
@@ -513,6 +507,12 @@ impl<'tcx> EncodeContext<'tcx> {
513507
let proc_macro_data = self.encode_proc_macros();
514508
let proc_macro_data_bytes = self.position() - i;
515509

510+
// Encode exported symbols info.
511+
i = self.position();
512+
let exported_symbols = self.tcx.exported_symbols(LOCAL_CRATE);
513+
let exported_symbols = self.encode_exported_symbols(&exported_symbols);
514+
let exported_symbols_bytes = self.position() - i;
515+
516516
let attrs = tcx.hir().krate_attrs();
517517
let has_default_lib_allocator = attr::contains_name(&attrs, sym::default_lib_allocator);
518518

src/librustc_metadata/rmeta/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,15 @@ crate struct CrateRoot<'tcx> {
196196
source_map: Lazy<[rustc_span::SourceFile]>,
197197
def_path_table: Lazy<map::definitions::DefPathTable>,
198198
impls: Lazy<[TraitImpls]>,
199-
exported_symbols: Lazy!([(ExportedSymbol<'tcx>, SymbolExportLevel)]),
200199
interpret_alloc_index: Lazy<[u32]>,
201200

202201
per_def: LazyPerDefTables<'tcx>,
203202

204203
/// The DefIndex's of any proc macros declared by this crate.
205204
proc_macro_data: Option<Lazy<[DefIndex]>>,
206205

206+
exported_symbols: Lazy!([(ExportedSymbol<'tcx>, SymbolExportLevel)]),
207+
207208
compiler_builtins: bool,
208209
needs_allocator: bool,
209210
needs_panic_runtime: bool,

0 commit comments

Comments
 (0)