3 use rustc_data_structures::fx::FxHashMap;
4 use rustc_hir::def::Res;
5 use rustc_hir::def_id::LocalDefId;
6 use rustc_macros::HashStable;
7 use rustc_span::symbol::Ident;
12 /// This is the replacement export map. It maps a module to all of the exports
14 pub type ExportMap<Id> = FxHashMap<LocalDefId, Vec<Export<Id>>>;
16 #[derive(Copy, Clone, Debug, TyEncodable, TyDecodable, HashStable)]
17 pub struct Export<Id> {
18 /// The name of the target.
20 /// The resolution of the target.
22 /// The span of the target.
24 /// The visibility of the export.
25 /// We include non-`pub` exports for hygienic macros that get used from extern crates.
26 pub vis: ty::Visibility,
30 pub fn map_id<R>(self, map: impl FnMut(Id) -> R) -> Export<R> {
31 Export { ident: self.ident, res: self.res.map_id(map), span: self.span, vis: self.vis }