1
Fork 0
rust/compiler/rustc_session/src
bors 92f5dea0eb 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`
2023-05-19 00:41:32 +00:00
..
config Change process spawning to inherit the parent's signal mask by default 2022-10-20 14:53:38 -07:00
cgu_reuse_tracker.rs Remove useless borrows and derefs 2022-12-01 17:34:43 +00:00
code_stats.rs Simplify sort_by calls 2023-03-07 18:13:41 +00:00
config.rs Auto merge of #109602 - bvanjoi:fix-issue-109343, r=petrochenkov 2023-05-19 00:41:32 +00:00
cstore.rs Remove MetadataRef type alias 2023-05-16 11:55:47 +00:00
errors.rs Rollup merge of #108801 - fee1-dead-contrib:c-str, r=compiler-errors 2023-05-05 18:40:33 +05:30
filesearch.rs bump windows crate 0.46 -> 0.48 in workspace 2023-05-09 18:20:13 +03:00
lib.rs Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
options.rs Avoid &format("...") calls in error message code. 2023-05-16 17:59:56 +10:00
output.rs rustc: Remove unused Session argument from some attribute functions 2023-03-22 13:55:55 +04:00
parse.rs Avoid &format("...") calls in error message code. 2023-05-16 17:59:56 +10:00
search_paths.rs incr. comp.: Don't export impl_stable_hash_via_hash!() and warn about using it. 2022-04-19 10:43:20 +02:00
session.rs Auto merge of #111345 - jyn514:cfg-release-caching, r=cjgillot,est31 2023-05-18 21:45:02 +00:00
utils.rs Rollup merge of #109231 - Zoxc:fs-non-canon, r=eholk 2023-03-23 19:55:45 +01:00