Skip to content

rustc_privacy: Do not export items needed solely for the reachability analysis #29620

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Nov 6, 2015

Conversation

petrochenkov
Copy link
Contributor

Handle them in middle::reachable instead (no optimizations so far, just drop all trait impl items into the reachable set, as before). Addresses the concerns from #29291 (comment)

  • In middle::reachable don't treat impls of Drop specially, they are subsumed by the general impl treatment.
  • Add some tests checking reachability of trait methods written in UFCS form
  • Minor refactoring in the second commit

r? @alexcrichton

… analysis

Process them in middle::reachable instead
Add tests for reachability of trait methods written in UFCS form
@alexcrichton
Copy link
Member

@bors: r+ 1d69397

self.exported_items.insert(item.id);
if exported_ty && exported_trait {
self.exported_items.insert(item.id);
}
Copy link
Member

Choose a reason for hiding this comment

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

This pattern comes up quite a bit in this module of:

if public {
    self.public_items.insert(id);
}
if exported {
    self.exported_items.insert(id);
}

Perhaps that could be a helper/macro? Not sure if it'd help readability, but figured I'd throw out the idea!

@bors
Copy link
Collaborator

bors commented Nov 6, 2015

⌛ Testing commit 1d69397 with merge 7cd8f69...

bors added a commit that referenced this pull request Nov 6, 2015
Handle them in `middle::reachable` instead (no optimizations so far, just drop all trait impl items into the reachable set, as before). Addresses the concerns from #29291 (comment)
\+ In `middle::reachable` don't treat impls of `Drop` specially, they are subsumed by the general impl treatment.
\+ Add some tests checking reachability of trait methods written in UFCS form
\+ Minor refactoring in the second commit

r? @alexcrichton
@bors bors merged commit 1d69397 into rust-lang:master Nov 6, 2015
@petrochenkov petrochenkov deleted the reachable2 branch November 22, 2015 11:36
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants