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

Fix nested imports not included in the save_analysis output #47081

Merged
merged 1 commit into from
Jan 12, 2018

Conversation

pietroalbini
Copy link
Member

This PR fixes #46823.

The bug was caused by the old access level checking code, which checked against the root UseTree even for nested trees. The problem with that is, for nested trees the root is lowered as an empty ListStem, which is not reachable by definition. The new code computes the access level with each tree's own ID, and with the root tree's visibility.

I tested this manually and it works, but I'm not really satisfied with that. I looked at the existing tests though, and no one checked for the save_analysis output as far as I can see. How should I proceed with that? I think having a test about this would be really nice.

@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 @petrochenkov (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.

@petrochenkov
Copy link
Contributor

r? @nrc

@rust-highfive rust-highfive assigned nrc and unassigned petrochenkov Dec 31, 2017
@kennytm
Copy link
Member

kennytm commented Jan 3, 2018

Thanks for the PR! We’ll periodically check in on it to make sure that @nrc or someone else from the team reviews it soon.

@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 3, 2018
@carols10cents
Copy link
Member

review ping @nrc ! pinging you on IRC too!

@nrc
Copy link
Member

nrc commented Jan 12, 2018

@bors: r+

@bors
Copy link
Contributor

bors commented Jan 12, 2018

📌 Commit 9991fdf has been approved by nrc

@nrc
Copy link
Member

nrc commented Jan 12, 2018

@pietroalbini we don't really have tests for save-analysis beyond a smoke test to check we don't crash when running with -Zsave-analysis. I have some ideas for implementing tests, but it's kind of a lot of work. Let me know if you happen to be interested in implementing such a project.

@pietroalbini
Copy link
Member Author

@nrc I'll see what I can do. Can you open an issue with your ideas?

kennytm added a commit to kennytm/rust that referenced this pull request Jan 12, 2018
…r=nrc

Fix nested imports not included in the save_analysis output

This PR fixes rust-lang#46823.

The bug was caused by the old access level checking code, which checked against the root UseTree even for nested trees. The problem with that is, for nested trees the root is lowered as an empty `ListStem`, which is not reachable by definition. The new code computes the access level with each tree's own ID, and with the root tree's visibility.

I tested this manually and it works, but I'm not really satisfied with that. I looked at the existing tests though, and no one checked for the save_analysis output as far as I can see. How should I proceed with that? I think having a test about this would be really nice.
bors added a commit that referenced this pull request Jan 12, 2018
@bors bors merged commit 9991fdf into rust-lang:master Jan 12, 2018
@pietroalbini pietroalbini deleted the fix-nested-tree-dump branch January 13, 2018 09:57
@nrc
Copy link
Member

nrc commented Jan 29, 2018

@pietroalbini sorry it took a while, notes are at #34481 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nested use trees are not reachable
7 participants