about summary refs log tree commit diff
path: root/compiler/rustc_session
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-05-19 00:41:32 +0000
committerbors <bors@rust-lang.org>2023-05-19 00:41:32 +0000
commit92f5dea0ebe2e34ad8411e8cd8a0c97dd45b3400 (patch)
tree599b16ef1b643e5f18ea1b8d4baacd3fc1b5067c /compiler/rustc_session
parentc9dc55d05c9a111300271b7f8b8f62220ce9ad1e (diff)
parentf34678c0976086523f56a0f974e76cfc5ca2fc40 (diff)
downloadrust-92f5dea0ebe2e34ad8411e8cd8a0c97dd45b3400.tar.gz
rust-92f5dea0ebe2e34ad8411e8cd8a0c97dd45b3400.zip
Auto merge of #109602 - bvanjoi:fix-issue-109343, r=petrochenkov
fix(resolve): replace bindings to dummy for unresolved imports

close #109343

In #109343, `f` in `pub use f as g` points to:

|namespace| binding|
|-|-|
|type| `external crate f`|
|value| `None` |
|macro| `None` |

When resolve `value_ns` during `resolve_doc_links`, the value of the binding of single_import `pub use f as g` goes to `pub use inner::f`, and since it does not satisfy [!self.is_accessible_from(binding.vis, single_import.parent_scope.module)](https://github.com/rust-lang/rust/blob/master/compiler/rustc_resolve/src/ident.rs#L971) and returns `Err(Undetermined)`, which eventually goes to `PathResult::Indeterminate => unreachable!`.

This PR replace all namespace binding to `dummy_binding` for indeterminate import, so, the bindings of `pub use f as g` had been changed to followings after finalize:

|namespace| binding|
|-|-|
|type| `dummy`|
|value| `dummy` |
|macro| `dummy` |

r?`@petrochenkov`
Diffstat (limited to 'compiler/rustc_session')
-rw-r--r--compiler/rustc_session/src/config.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
index 39e255104d5..a328447aca9 100644
--- a/compiler/rustc_session/src/config.rs
+++ b/compiler/rustc_session/src/config.rs
@@ -421,7 +421,7 @@ pub enum TrimmedDefPaths {
     GoodPath,
 }
 
-#[derive(Clone, Hash)]
+#[derive(Clone, Hash, Debug)]
 pub enum ResolveDocLinks {
     /// Do not resolve doc links.
     None,