Skip to content

Check the privacy of implemented traits #10862

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

Merged
merged 1 commit into from
Dec 10, 2013

Conversation

alexcrichton
Copy link
Member

This bug showed up because the visitor only visited the path of the implemented
trait via walk_path (with no corresponding visit_path function). I have modified
the visitor to use visit_path (which is now overridable), and the privacy
visitor overrides this function and now properly checks for the privacy of all
paths.

Closes #10857

view_path_list(ref path, ref list, _) => {
for id in list.iter() {
visitor.visit_ident(id.span, id.node.name, env.clone())
}
path
walk_path(visitor, path, 1, env.clone()); // id is ignored
Copy link
Member

Choose a reason for hiding this comment

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

1 for id being ignored?

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't visit_path/walk_path take Option<NodeId> instead?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see, id is ignored specifically by walk_path, not just in this instance.

This bug showed up because the visitor only visited the path of the implemented
trait via walk_path (with no corresponding visit_path function). I have modified
the visitor to use visit_path (which is now overridable), and the privacy
visitor overrides this function and now properly checks for the privacy of all
paths.

Closes rust-lang#10857
bors added a commit that referenced this pull request Dec 10, 2013
This bug showed up because the visitor only visited the path of the implemented
trait via walk_path (with no corresponding visit_path function). I have modified
the visitor to use visit_path (which is now overridable), and the privacy
visitor overrides this function and now properly checks for the privacy of all
paths.

Closes #10857
@bors bors closed this Dec 10, 2013
@bors bors merged commit 9522a08 into rust-lang:master Dec 10, 2013
@alexcrichton alexcrichton deleted the issue-10857 branch December 11, 2013 05:39
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 30, 2023
Update *Current stable* text in `CHANGELOG.md`

Roses are red,
violets are blue,
the new version was released,
and our changelog too

---

changelog: none
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.

Trait visability is not consistent.
3 participants