Skip to content

Commit 7646c44

Browse files
committed
add a few more alternatives based on review of comment thread so far.
1 parent cf38675 commit 7646c44

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

text/0000-pub-restricted.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,30 @@ tree for all of its re-exports.
796796
do the inline refactoring, rewriting each `pub(crate)` as `pub(A1)`
797797
as necessary.
798798

799+
## Be more ambitious!
800+
801+
This feature could be extended in various ways.
802+
803+
For example:
804+
805+
* As mentioned on the RFC comment thread,
806+
we could allow multiple paths in the restriction-specification:
807+
`pub(path1, path2, path3)`.
808+
809+
This, for better or worse, would start
810+
to look a lot like `friend` declarations from C++.
811+
812+
* Also as mentioned on the RFC comment thread, the
813+
`pub(restricted)` form does not have any variant where the
814+
restrction-specification denotes the whole universe.
815+
In other words, there's no current way to get the same effect
816+
as `pub item` via `pub(restricted) item`.
817+
818+
Some future syntaxes to support this have been proposed in the
819+
RFC comment thread, such as `pub(::)`. But this RFC is leaving the
820+
actual choice to add such an extension (and what syntax to use
821+
for it) up to a later amendment in the future.
822+
799823
# Unresolved questions
800824
[unresolved]: #unresolved-questions
801825

0 commit comments

Comments
 (0)