let is_good_import =
binding.is_import() && !binding.is_ambiguity() && !ident.span.from_expansion();
if is_good_import || binding.is_macro_def() {
- let res = binding.res();
- if res != Res::Err {
+ let res = binding.res().map_id(|id| this.definitions.local_def_id(id));
+ if res != def::Res::Err {
reexports.push(Export { ident, res, span: binding.span, vis: binding.vis });
}
}
if !reexports.is_empty() {
if let Some(def_id) = module.def_id() {
- self.r.export_map.insert(def_id, reexports);
+ // Call to `expect_local` should be fine because current
+ // code is only called for local modules.
+ self.r.export_map.insert(def_id.expect_local(), reexports);
}
}
}