Skip to content

Update pub(in path) for 2018. #480

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 2 commits into from
Dec 17, 2018
Merged

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Dec 10, 2018

When updating paths, I neglected to add a note that visibility paths must
be absolute.

When updating paths, I neglected to add a note that visibility paths must
be absolute.
@@ -154,13 +154,18 @@ be a parent module of the item whose visibility is being declared.
- `pub(self)` makes an item visible to the current module. This is equivalent
to `pub(in self)`.

> **Edition Differences**: Starting with the 2018 edition, paths for
> `pub(in path)` must start with `crate`, `self`, or `super`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this just a consequence of the path having to be absolute?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but there is nothing else that explicitly calls that out for visibility paths. The only other part is the "use declarations", which only talk about the requirements in use declarations. Or are you saying it should be worded differently?

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't realise how the reference described paths in use items. The wording here is probably fine, but I think that there should be some wording on how paths that start with an identifier are resolved in the 2015 edition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, good catch!

@matthewjasper matthewjasper merged commit 2a487bd into rust-lang:master Dec 17, 2018
@matthewjasper
Copy link
Contributor

Thanks!

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.

2 participants