File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -1099,12 +1099,12 @@ impl clean::Visibility {
10991099 clean:: Visibility :: Restricted ( vis_did) => {
11001100 let parent_module = find_closest_parent_module ( tcx, item_did) ;
11011101
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) {
11031105 // `pub(in foo)` where `foo` is the parent module
11041106 // is the same as no visibility modifier
11051107 Ok ( ( ) )
1106- } else if vis_did. index == CRATE_DEF_INDEX {
1107- write ! ( f, "pub(crate) " )
11081108 } else if parent_module
11091109 . map ( |parent| find_closest_parent_module ( tcx, parent) )
11101110 . flatten ( )
Original file line number Diff line number Diff line change 22
33#![ feature( decl_macro) ]
44
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() {'
66// @has - //pre '...'
77// @has - //pre '}'
88pub ( crate ) macro crate_macro ( ) { }
Original file line number Diff line number Diff line change 66
77// @has 'foo/struct.FooPublic.html' '//pre' 'pub struct FooPublic'
88pub struct FooPublic ;
9- // @has 'foo/struct.FooJustCrate.html' '//pre' 'struct FooJustCrate'
9+ // @has 'foo/struct.FooJustCrate.html' '//pre' 'pub(crate) struct FooJustCrate'
1010crate struct FooJustCrate ;
11- // @has 'foo/struct.FooPubCrate.html' '//pre' 'struct FooPubCrate'
11+ // @has 'foo/struct.FooPubCrate.html' '//pre' 'pub(crate) struct FooPubCrate'
1212pub ( crate ) struct FooPubCrate ;
13- // @has 'foo/struct.FooSelf.html' '//pre' 'struct FooSelf'
13+ // @has 'foo/struct.FooSelf.html' '//pre' 'pub(crate) struct FooSelf'
1414pub ( self ) struct FooSelf ;
15- // @has 'foo/struct.FooInSelf.html' '//pre' 'struct FooInSelf'
15+ // @has 'foo/struct.FooInSelf.html' '//pre' 'pub(crate) struct FooInSelf'
1616pub ( in self ) struct FooInSelf ;
1717mod a {
1818 // @has 'foo/a/struct.FooASuper.html' '//pre' 'pub(crate) struct FooASuper'
You can’t perform that action at this time.
0 commit comments