]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_resolve/imports.rs
Rollup merge of #72780 - GuillaumeGomez:enforce-doc-alias-check, r=ollie27
[rust.git] / src / librustc_resolve / imports.rs
index a1e05d21b58d524bebabc187d44f5663661c6822..74a8b7e2f556d3c05310419d84cd5ffb32cb07c5 100644 (file)
@@ -1393,8 +1393,8 @@ fn finalize_resolutions_in(&mut self, module: Module<'b>) {
             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 });
                 }
             }
@@ -1467,7 +1467,9 @@ fn finalize_resolutions_in(&mut self, module: Module<'b>) {
 
         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);
             }
         }
     }