@@ -16,10 +16,10 @@ use rustc_span::symbol::{kw, sym, Symbol};
1616use rustc_target:: abi:: { Layout , Primitive , TagEncoding , Variants } ;
1717
1818use super :: {
19- collect_paths_for_type, document, document_at_level , ensure_trailing_slash, item_ty_to_strs,
20- notable_traits_decl , render_assoc_item, render_assoc_items, render_attributes_in_code,
21- render_attributes_in_pre , render_impl, render_stability_since_raw, write_srclink,
22- AssocItemLink , Context , ImplRenderingParameters ,
19+ collect_paths_for_type, document, ensure_trailing_slash, item_ty_to_strs, notable_traits_decl ,
20+ render_assoc_item, render_assoc_items, render_attributes_in_code, render_attributes_in_pre ,
21+ render_impl, render_stability_since_raw, write_srclink, AssocItemLink , Context ,
22+ ImplRenderingParameters ,
2323} ;
2424use crate :: clean:: { self , GetDefId } ;
2525use crate :: formats:: item_type:: ItemType ;
@@ -173,7 +173,7 @@ fn toggle_close(w: &mut Buffer) {
173173}
174174
175175fn item_module ( w : & mut Buffer , cx : & Context < ' _ > , item : & clean:: Item , items : & [ clean:: Item ] ) {
176- document ( w, cx, item, None ) ;
176+ document ( w, cx, item, None , 1 ) ;
177177
178178 let mut indices = ( 0 ..items. len ( ) ) . filter ( |i| !items[ * i] . is_stripped ( ) ) . collect :: < Vec < usize > > ( ) ;
179179
@@ -485,7 +485,7 @@ fn item_function(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, f: &clean::
485485 notable_traits = notable_traits_decl( & f. decl, cx) ,
486486 ) ;
487487 } ) ;
488- document ( w, cx, it, None )
488+ document ( w, cx, it, None , 1 )
489489}
490490
491491fn item_trait ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item , t : & clean:: Trait ) {
@@ -608,7 +608,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
608608 } ) ;
609609
610610 // Trait documentation
611- document ( w, cx, it, None ) ;
611+ document ( w, cx, it, None , 1 ) ;
612612
613613 fn write_small_section_header ( w : & mut Buffer , id : & str , title : & str , extra_content : & str ) {
614614 write ! (
@@ -626,7 +626,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
626626 let item_type = m. type_ ( ) ;
627627 let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
628628 let mut content = Buffer :: empty_from ( w) ;
629- document_at_level ( & mut content, cx, m, Some ( t) , 3 ) ;
629+ document ( & mut content, cx, m, Some ( t) , 4 ) ;
630630 let toggled = !content. is_empty ( ) ;
631631 if toggled {
632632 write ! ( w, "<details class=\" rustdoc-toggle\" open><summary>" ) ;
@@ -840,7 +840,7 @@ fn item_trait_alias(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clea
840840 ) ;
841841 } ) ;
842842
843- document ( w, cx, it, None ) ;
843+ document ( w, cx, it, None , 1 ) ;
844844
845845 // Render any items associated directly to this alias, as otherwise they
846846 // won't be visible anywhere in the docs. It would be nice to also show
@@ -862,7 +862,7 @@ fn item_opaque_ty(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean:
862862 ) ;
863863 } ) ;
864864
865- document ( w, cx, it, None ) ;
865+ document ( w, cx, it, None , 1 ) ;
866866
867867 // Render any items associated directly to this alias, as otherwise they
868868 // won't be visible anywhere in the docs. It would be nice to also show
@@ -893,7 +893,7 @@ fn item_typedef(
893893 ) ;
894894 } ) ;
895895
896- document ( w, cx, it, None ) ;
896+ document ( w, cx, it, None , 1 ) ;
897897
898898 let def_id = it. def_id . expect_def_id ( ) ;
899899 // Render any items associated directly to this alias, as otherwise they
@@ -911,7 +911,7 @@ fn item_union(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::Uni
911911 } ) ;
912912 } ) ;
913913
914- document ( w, cx, it, None ) ;
914+ document ( w, cx, it, None , 1 ) ;
915915
916916 let mut fields = s
917917 . fields
@@ -944,7 +944,7 @@ fn item_union(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::Uni
944944 if let Some ( stability_class) = field. stability_class ( cx. tcx ( ) ) {
945945 write ! ( w, "<span class=\" stab {stab}\" ></span>" , stab = stability_class) ;
946946 }
947- document ( w, cx, field, Some ( it) ) ;
947+ document ( w, cx, field, Some ( it) , 1 ) ;
948948 }
949949 }
950950 let def_id = it. def_id . expect_def_id ( ) ;
@@ -1026,7 +1026,7 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
10261026 } ) ;
10271027 } ) ;
10281028
1029- document ( w, cx, it, None ) ;
1029+ document ( w, cx, it, None , 1 ) ;
10301030
10311031 if !e. variants . is_empty ( ) {
10321032 write ! (
@@ -1055,7 +1055,7 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
10551055 w. write_str ( "</code>" ) ;
10561056 render_stability_since ( w, variant, it, cx. tcx ( ) ) ;
10571057 w. write_str ( "</div>" ) ;
1058- document ( w, cx, variant, Some ( it) ) ;
1058+ document ( w, cx, variant, Some ( it) , 1 ) ;
10591059 document_non_exhaustive ( w, variant) ;
10601060
10611061 use crate :: clean:: Variant ;
@@ -1095,7 +1095,7 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
10951095 f = field. name. as_ref( ) . unwrap( ) ,
10961096 t = ty. print( cx)
10971097 ) ;
1098- document ( w, cx, field, Some ( variant) ) ;
1098+ document ( w, cx, field, Some ( variant) , 1 ) ;
10991099 }
11001100 _ => unreachable ! ( ) ,
11011101 }
@@ -1122,7 +1122,7 @@ fn item_macro(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Mac
11221122 None ,
11231123 ) ;
11241124 } ) ;
1125- document ( w, cx, it, None )
1125+ document ( w, cx, it, None , 1 )
11261126}
11271127
11281128fn item_proc_macro ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item , m : & clean:: ProcMacro ) {
@@ -1152,11 +1152,11 @@ fn item_proc_macro(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, m: &clean
11521152 } ) ;
11531153 }
11541154 }
1155- document ( w, cx, it, None )
1155+ document ( w, cx, it, None , 1 )
11561156}
11571157
11581158fn item_primitive ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item ) {
1159- document ( w, cx, it, None ) ;
1159+ document ( w, cx, it, None , 1 ) ;
11601160 render_assoc_items ( w, cx, it, it. def_id . expect_def_id ( ) , AssocItemRender :: All )
11611161}
11621162
@@ -1195,7 +1195,7 @@ fn item_constant(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, c: &clean::
11951195 }
11961196 } ) ;
11971197
1198- document ( w, cx, it, None )
1198+ document ( w, cx, it, None , 1 )
11991199}
12001200
12011201fn item_struct ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item , s : & clean:: Struct ) {
@@ -1206,7 +1206,7 @@ fn item_struct(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::St
12061206 } ) ;
12071207 } ) ;
12081208
1209- document ( w, cx, it, None ) ;
1209+ document ( w, cx, it, None , 1 ) ;
12101210
12111211 let mut fields = s
12121212 . fields
@@ -1242,7 +1242,7 @@ fn item_struct(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::St
12421242 name = field_name,
12431243 ty = ty. print( cx)
12441244 ) ;
1245- document ( w, cx, field, Some ( it) ) ;
1245+ document ( w, cx, field, Some ( it) , 1 ) ;
12461246 }
12471247 }
12481248 }
@@ -1263,7 +1263,7 @@ fn item_static(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::St
12631263 typ = s. type_. print( cx)
12641264 ) ;
12651265 } ) ;
1266- document ( w, cx, it, None )
1266+ document ( w, cx, it, None , 1 )
12671267}
12681268
12691269fn item_foreign_type ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item ) {
@@ -1278,13 +1278,13 @@ fn item_foreign_type(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item) {
12781278 ) ;
12791279 } ) ;
12801280
1281- document ( w, cx, it, None ) ;
1281+ document ( w, cx, it, None , 1 ) ;
12821282
12831283 render_assoc_items ( w, cx, it, it. def_id . expect_def_id ( ) , AssocItemRender :: All )
12841284}
12851285
12861286fn item_keyword ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item ) {
1287- document ( w, cx, it, None )
1287+ document ( w, cx, it, None , 1 )
12881288}
12891289
12901290/// Compare two strings treating multi-digit numbers as single units (i.e. natural sort order).
0 commit comments