File tree 3 files changed +8
-8
lines changed
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -1099,12 +1099,12 @@ impl clean::Visibility {
1099
1099
clean:: Visibility :: Restricted ( vis_did) => {
1100
1100
let parent_module = find_closest_parent_module ( tcx, item_did) ;
1101
1101
1102
- if parent_module == Some ( vis_did) {
1102
+ if vis_did. index == CRATE_DEF_INDEX {
1103
+ write ! ( f, "pub(crate) " )
1104
+ } else if parent_module == Some ( vis_did) {
1103
1105
// `pub(in foo)` where `foo` is the parent module
1104
1106
// is the same as no visibility modifier
1105
1107
Ok ( ( ) )
1106
- } else if vis_did. index == CRATE_DEF_INDEX {
1107
- write ! ( f, "pub(crate) " )
1108
1108
} else if parent_module
1109
1109
. map ( |parent| find_closest_parent_module ( tcx, parent) )
1110
1110
. flatten ( )
Original file line number Diff line number Diff line change 2
2
3
3
#![ feature( decl_macro) ]
4
4
5
- // @has decl_macro_priv/macro.crate_macro.html //pre 'macro crate_macro() {'
5
+ // @has decl_macro_priv/macro.crate_macro.html //pre 'pub(crate) macro crate_macro() {'
6
6
// @has - //pre '...'
7
7
// @has - //pre '}'
8
8
pub ( crate ) macro crate_macro ( ) { }
Original file line number Diff line number Diff line change 6
6
7
7
// @has 'foo/struct.FooPublic.html' '//pre' 'pub struct FooPublic'
8
8
pub struct FooPublic ;
9
- // @has 'foo/struct.FooJustCrate.html' '//pre' 'struct FooJustCrate'
9
+ // @has 'foo/struct.FooJustCrate.html' '//pre' 'pub(crate) struct FooJustCrate'
10
10
crate struct FooJustCrate ;
11
- // @has 'foo/struct.FooPubCrate.html' '//pre' 'struct FooPubCrate'
11
+ // @has 'foo/struct.FooPubCrate.html' '//pre' 'pub(crate) struct FooPubCrate'
12
12
pub ( crate ) struct FooPubCrate ;
13
- // @has 'foo/struct.FooSelf.html' '//pre' 'struct FooSelf'
13
+ // @has 'foo/struct.FooSelf.html' '//pre' 'pub(crate) struct FooSelf'
14
14
pub ( self ) struct FooSelf ;
15
- // @has 'foo/struct.FooInSelf.html' '//pre' 'struct FooInSelf'
15
+ // @has 'foo/struct.FooInSelf.html' '//pre' 'pub(crate) struct FooInSelf'
16
16
pub ( in self ) struct FooInSelf ;
17
17
mod a {
18
18
// @has 'foo/a/struct.FooASuper.html' '//pre' 'pub(crate) struct FooASuper'
You can’t perform that action at this time.
0 commit comments