-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
resolve: Fix one more ICE in import validation #57185
Conversation
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
Beta-nominating as a regression fix, the assert was introduced in stable Rust 1.31 (in #55884). |
I'm glad I added all those asserts in #55884. |
r=me once travis' done |
@petrochenkov lol, sorry XD -- in my defense it looked like sometihng you'd be qualified to review! |
@bors r=estebank |
📌 Commit ddb550a has been approved by |
resolve: Fix one more ICE in import validation So if you have an unresolved import ```rust mod m { use foo::bar; } ``` error recovery will insert a special item with `Def::Err` definition into module `m`, so other things depending on `bar` won't produce extra errors. The issue was that erroneous `bar` was overwriting legitimate `bar`s coming from globs, e.g. ```rust mod m { use baz::*; // imports real existing `bar` use foo::bar; } ``` causing some unwanted diagnostics talking about "unresolved items", and producing inconsistent resolutions like #57015. This PR stops overwriting real successful resolutions with `Def::Err`s. Fixes #57015
☀️ Test successful - status-appveyor, status-travis |
[beta] Rollup backports Cherry-picked: * #57053: Fix alignment for array indexing * #57181: resolve: Fix another ICE in import validation * #57185: resolve: Fix one more ICE in import validation * #57282: Wf-check the output type of a function in MIR-typeck * #55318: Ensure that Rustdoc discovers all necessary auto trait bounds * #56838: Call poly_project_and_unify_type on types that contain inference types Rolled up: * #57300: [beta] Update RLS to include 100% CPU on hover bugfix * #57301: beta: bootstrap from latest stable (1.31.1) * #57292: [BETA] Update cargo r? @ghost
So if you have an unresolved import
error recovery will insert a special item with
Def::Err
definition into modulem
, so other things depending onbar
won't produce extra errors.The issue was that erroneous
bar
was overwriting legitimatebar
s coming from globs, e.g.causing some unwanted diagnostics talking about "unresolved items", and producing inconsistent resolutions like #57015.
This PR stops overwriting real successful resolutions with
Def::Err
s.Fixes #57015