@@ -813,7 +813,9 @@ For example:
813
813
` pub(restricted) ` form does not have any variant where the
814
814
restrction-specification denotes the whole universe.
815
815
In other words, there's no current way to get the same effect
816
- as ` pub item ` via ` pub(restricted) item ` .
816
+ as ` pub item ` via ` pub(restricted) item ` ; you cannot say
817
+ ` pub(universe) item ` (even though I do so in a tongue-in-cheek
818
+ manner elsewhere in this RFC).
817
819
818
820
Some future syntaxes to support this have been proposed in the
819
821
RFC comment thread, such as ` pub(::) ` . But this RFC is leaving the
@@ -906,6 +908,49 @@ even in the context of a non-pub module like `mod b`. In particular,
906
908
` pub(super) use item ` may be imposing a new restriction on the
907
909
re-exported name that was not part of its original definition.)
908
910
911
+ ## Interaction with Globs
912
+
913
+ Glob re-exports
914
+ currently only re-export ` pub ` (as in ` pub(universe) ` items).
915
+
916
+ What should glob-reepxorts do with respect to ` pub(restricted) ` ?
917
+
918
+ Here is an illustrating example pointed out by petrochenkov in the
919
+ comment thread:
920
+
921
+ ``` rust
922
+ mod m {
923
+ /*priv*/ pub (m ) struct S1 ;
924
+ pub (super ) S2 ;
925
+ pub (foo :: bar ) S3 ;
926
+ pub S4 ;
927
+
928
+ mod n {
929
+
930
+ // What is reexported here?
931
+ // Just `S4`?
932
+ // Anything in `m` visible
933
+ // to `n` (which is not consisent with the current treatment of
934
+ `pub ` by globs ).
935
+
936
+ pub use m :: * ;
937
+ }
938
+ }
939
+
940
+ // What is reexported here?
941
+ pub use m :: * ;
942
+ pub (baz :: qux ) use m :: * ;
943
+ ```
944
+
945
+ This remains an unresolved question, but my personal inclination, at
946
+ least for the initial implementation, is to make globs only import
947
+ purely ` pub ` items; no non-` pub ` , and no ` pub(restricted) ` .
948
+
949
+ After we get more experience with ` pub(restricted) ` (and perhaps make
950
+ other changes that may come in future RFCs), we will be in a better
951
+ position to evaluate what to do here.
952
+
953
+
909
954
# Appendices
910
955
911
956
## Associated Items Digression
0 commit comments