File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -154,13 +154,18 @@ be a parent module of the item whose visibility is being declared.
154154- ` pub(self) ` makes an item visible to the current module. This is equivalent
155155to ` pub(in self) ` .
156156
157+ > ** Edition Differences** : Starting with the 2018 edition, paths for
158+ > ` pub(in path) ` must start with ` crate ` , ` self ` , or ` super ` .
159+
157160Here's an example:
158161
159162``` rust
160163pub mod outer_mod {
161164 pub mod inner_mod {
162165 // This function is visible within `outer_mod`
163- pub (in outer_mod ) fn outer_mod_visible_fn () {}
166+ pub (in crate :: outer_mod ) fn outer_mod_visible_fn () {}
167+ // Same as above, this is only valid in the 2015 edition.
168+ pub (in outer_mod ) fn outer_mod_visible_fn_2015 () {}
164169
165170 // This function is visible to the entire crate
166171 pub (crate ) fn crate_visible_fn () {}
You can’t perform that action at this time.
0 commit comments