rustc_metadata: Do not encode empty reexport lists
This is more a cleanup than optimization
This commit is contained in:
parent
66ccf36f16
commit
f3b5791a47
1 changed files with 5 additions and 7 deletions
|
@ -1267,13 +1267,6 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
|||
// the crate root for consistency with other crates (some of the resolver
|
||||
// code uses it). However, we skip encoding anything relating to child
|
||||
// items - we encode information about proc-macros later on.
|
||||
let reexports = if !self.is_proc_macro {
|
||||
tcx.module_reexports(local_def_id).unwrap_or(&[])
|
||||
} else {
|
||||
&[]
|
||||
};
|
||||
|
||||
record_array!(self.tables.module_reexports[def_id] <- reexports);
|
||||
if self.is_proc_macro {
|
||||
// Encode this here because we don't do it in encode_def_ids.
|
||||
record!(self.tables.expn_that_defined[def_id] <- tcx.expn_that_defined(local_def_id));
|
||||
|
@ -1305,6 +1298,11 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
}));
|
||||
|
||||
if let Some(reexports) = tcx.module_reexports(local_def_id) {
|
||||
assert!(!reexports.is_empty());
|
||||
record_array!(self.tables.module_reexports[def_id] <- reexports);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue