File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1097,12 +1097,20 @@ impl clean::Visibility {
10971097 clean:: Inherited => Ok ( ( ) ) ,
10981098
10991099 clean:: Visibility :: Restricted ( vis_did) => {
1100- if find_closest_parent_module ( tcx, item_did) == Some ( vis_did) {
1100+ let parent_module = find_closest_parent_module ( tcx, item_did) ;
1101+
1102+ if parent_module == Some ( vis_did) {
11011103 // `pub(in foo)` where `foo` is the parent module
11021104 // is the same as no visibility modifier
11031105 Ok ( ( ) )
11041106 } else if vis_did. index == CRATE_DEF_INDEX {
11051107 write ! ( f, "pub(crate) " )
1108+ } else if parent_module
1109+ . map ( |parent| find_closest_parent_module ( tcx, parent) )
1110+ . flatten ( )
1111+ == Some ( vis_did)
1112+ {
1113+ write ! ( f, "pub(super) " )
11061114 } else {
11071115 f. write_str ( "pub(" ) ?;
11081116 let path = tcx. def_path ( vis_did) ;
You can’t perform that action at this time.
0 commit comments