Skip to content

Commit d739ca9

Browse files
committed
Encode exported symbols last
1 parent 36cbf0e commit d739ca9

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
@@ -435,12 +435,6 @@ impl<'tcx> EncodeContext<'tcx> {
435435
let impls = self.encode_impls();
436436
let impl_bytes = self.position() - i;
437437

438-
// Encode exported symbols info.
439-
i = self.position();
440-
let exported_symbols = self.tcx.exported_symbols(LOCAL_CRATE);
441-
let exported_symbols = self.encode_exported_symbols(&exported_symbols);
442-
let exported_symbols_bytes = self.position() - i;
443-
444438
let tcx = self.tcx;
445439

446440
// Encode the items.
@@ -481,6 +475,12 @@ impl<'tcx> EncodeContext<'tcx> {
481475
let proc_macro_data = self.encode_proc_macros();
482476
let proc_macro_data_bytes = self.position() - i;
483477

478+
// Encode exported symbols info.
479+
i = self.position();
480+
let exported_symbols = self.tcx.exported_symbols(LOCAL_CRATE);
481+
let exported_symbols = self.encode_exported_symbols(&exported_symbols);
482+
let exported_symbols_bytes = self.position() - i;
483+
484484
let attrs = tcx.hir().krate_attrs();
485485
let has_default_lib_allocator = attr::contains_name(&attrs, sym::default_lib_allocator);
486486

src/librustc_metadata/rmeta/mod.rs

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

201200
per_def: LazyPerDefTables<'tcx>,
202201

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

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

0 commit comments

Comments
 (0)