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: Suggest use self when import resolves #36289

Merged
merged 2 commits into from
Sep 7, 2016

Conversation

euclio
Copy link
Contributor

@euclio euclio commented Sep 6, 2016

Improves errors messages by replacing "Maybe a missing extern crate" messages
with "Did you mean self::..." when the self import would succeed.

Fixes #34191.

Thank you for the help @jseyfried!

Improves errors messages by replacing "Maybe a missing `extern crate`" messages
with "Did you mean `self::...`" when the `self` import would succeed.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nrc (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

Failed(Some((span, msg)))
},
_ => Failed(err),
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional nit: I think this match would look better as an if let (i.e. if let Success(_) = self_result { ... }).

@jseyfried
Copy link
Contributor

@euclio Thanks for the PR!
Looks good to me modulo the comment about self.current_module.

@jseyfried
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Sep 6, 2016

📌 Commit 288e7ca has been approved by jseyfried

@bors
Copy link
Contributor

bors commented Sep 7, 2016

⌛ Testing commit 288e7ca with merge 1f30d69...

@bors
Copy link
Contributor

bors commented Sep 7, 2016

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

@jseyfried
Copy link
Contributor

@bors retry

@bors
Copy link
Contributor

bors commented Sep 7, 2016

⌛ Testing commit 288e7ca with merge f707582...

bors added a commit that referenced this pull request Sep 7, 2016
resolve: Suggest `use self` when import resolves

Improves errors messages by replacing "Maybe a missing `extern crate`" messages
with "Did you mean `self::...`" when the `self` import would succeed.

Fixes #34191.

Thank you for the help @jseyfried!
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.

5 participants