-
Couldn't load subscription status.
- Fork 13.9k
fix(resolve): update shadowed_glob more precision #112495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
shadowed_glob when there had diff res for TypeNS|
All checks had passed, so @rustbot ready |
tests/ui/resolve/issue-105069.stderr
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you just fixed this FIXME - https://github.com/rust-lang/rust/pull/112086/files#diff-54ebaa0715c94a2acf974077e838aa584186e187f3d01edb1791fd71c78408caR937-R939 and we can now remove AmbiguityKind::Import in #112086.
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#112197 (Erase regions even if normalization fails in writeback (in new solver)) - rust-lang#112495 (fix(resolve): update shadowed_glob more precision) - rust-lang#112520 (Fix the overflow issue for transmute_generic_consts) - rust-lang#112571 (rustdoc-search: search never type with `!`) - rust-lang#112581 ([rustdoc] Fix URL encoding of % sign) r? `@ghost` `@rustbot` modify labels: rollup
inconsistent resolution for an import#109153assertion failed: import.imported_module.get().is_none()'#109962Why does it panic?
We use #109153 as an illustration.
The process of
resolve_importsis:(Mod(root), Ident(bar) in type ns)use foo::*binding-> foo::bar,shallowed_glob->Noneuse bar::barbinding-> foo::bar::bar,shallowed_glob-> foo::baruse bar::*binding-> foo::bar::bar,shallowed_glob-> foo::bar::bar::barSo during
finalize_import, theroot::barinuse bar::barhad been pointed tofoo::bar::bar::bar, which is different from theinitial_modulevalued offoo::bar, therefore, the panic had been triggered.Try to solve it
I think #109153 should check-pass rather than throw an ambiguous error. Following this idea, there are two ways to solve this problem:1. Give up theinitial_moduleand updateimport.imported_moduleafter each resolution update. However, I think this method may have too much impact.2. Do not update theshadowed_globwhen it is defined.To be honest, I am not sure if this is the right way to solve this ICE. Perhaps there is a better resolution.Edit: we had made the
resolution.shadowed_globupdate more detailed.r? @petrochenkov