3 use rustc_hir::def::Res;
4 use rustc_hir::def_id::DefIdMap;
5 use rustc_macros::HashStable;
11 /// This is the replacement export map. It maps a module to all of the exports
13 pub type ExportMap<Id> = DefIdMap<Vec<Export<Id>>>;
15 #[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable, HashStable)]
16 pub struct Export<Id> {
17 /// The name of the target.
18 pub ident: ast::Ident,
19 /// The resolution of the target.
21 /// The span of the target.
23 /// The visibility of the export.
24 /// We include non-`pub` exports for hygienic macros that get used from extern crates.
25 pub vis: ty::Visibility,
29 pub fn map_id<R>(self, map: impl FnMut(Id) -> R) -> Export<R> {
30 Export { ident: self.ident, res: self.res.map_id(map), span: self.span, vis: self.vis }