Skip to content
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

Merged
merged 3 commits into from
May 2, 2016

Conversation

jseyfried
Copy link
Contributor

@jseyfried jseyfried commented Apr 25, 2016

This PR improves diagnostics in resolve and lays some groundwork for resolving before ast->hir.

More specifically,

r? @eddyb

@@ -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
Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@jseyfried
Copy link
Contributor Author

jseyfried commented Apr 25, 2016

@GSam If you're still interested in maintaining / improving the refactoring tool, feel free to ping me and we can design a different API.

@jseyfried
Copy link
Contributor Author

cc @nrc

@nrc
Copy link
Member

nrc commented Apr 26, 2016

cc @aochagavia who's working on refactoring things now.

@aochagavia
Copy link
Contributor

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.

@bors
Copy link
Contributor

bors commented Apr 29, 2016

☔ The latest upstream changes (presumably #33232) made this pull request unmergeable. Please resolve the merge conflicts.

@jseyfried
Copy link
Contributor Author

r? @nrc

@rust-highfive rust-highfive assigned nrc and unassigned eddyb May 2, 2016
@nrc
Copy link
Member

nrc commented May 2, 2016

@bors: r+

@bors
Copy link
Contributor

bors commented May 2, 2016

📌 Commit a70e42a has been approved by nrc

@bors
Copy link
Contributor

bors commented May 2, 2016

⌛ Testing commit a70e42a with merge 700d3e2...

bors added a commit that referenced this pull request May 2, 2016
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
@bors
Copy link
Contributor

bors commented May 2, 2016

💔 Test failed - auto-win-gnu-32-opt

@alexcrichton
Copy link
Member

@bors bors merged commit a70e42a into rust-lang:master May 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

resolve: nonsensical diagnostics for an expression that resolves to a module
6 participants