-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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: improve diagnostics and lay groundwork for resolving before ast->hir #33190
Conversation
fa24baf
to
56dbe74
Compare
@@ -9,8 +9,8 @@ | |||
// except according to those terms. | |||
|
|||
mod foo { | |||
pub const b: u8 = 2; //~ NOTE constant defined here | |||
pub const d: u8 = 2; //~ NOTE constant defined here |
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.
We used to emit two notes for an conflicting imported constant -- one where the conflict was imported and another where the conflict was defined. For all other conflict errors, we only emit where the conflicting imported item was imported.
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.
I can re-implement the original behavior if desired, but I think it's better to be consistent and only emit one note.
@GSam If you're still interested in maintaining / improving the refactoring tool, feel free to ping me and we can design a different API. |
cc @nrc |
cc @aochagavia who's working on refactoring things now. |
I am not using the resolve functionality at the moment and am not sure if it will be necessary in the future, so I am ok with this. |
☔ The latest upstream changes (presumably #33232) made this pull request unmergeable. Please resolve the merge conflicts. |
56dbe74
to
a70e42a
Compare
r? @nrc |
@bors: r+ |
📌 Commit a70e42a has been approved by |
resolve: improve diagnostics and lay groundwork for resolving before ast->hir This PR improves diagnostics in `resolve` and lays some groundwork for resolving before ast->hir. More specifically, - It removes an API in `resolve` intended for external refactoring tools (see #27493) that appears not to be in active use. The API is incompatible with resolving before ast->hir, but could be rewritten in a more compatible and less intrusive way. - It improves the diagnostics for pattern bindings that conflict with `const`s. - It improves the diagnostics for modules used as expressions (fixes #33186). - It refactors away some uses of the hir map, which is unavavailable before ast->hir lowering. r? @eddyb
💔 Test failed - auto-win-gnu-32-opt |
This PR improves diagnostics in
resolve
and lays some groundwork for resolving before ast->hir.More specifically,
resolve
intended for external refactoring tools (see Changes required to help facilitate a refactoring tool #27493) that appears not to be in active use. The API is incompatible with resolving before ast->hir, but could be rewritten in a more compatible and less intrusive way.const
s.r? @eddyb