@@ -16,10 +16,10 @@ use rustc_span::symbol::{kw, sym, Symbol};
16
16
use rustc_target:: abi:: { Layout , Primitive , TagEncoding , Variants } ;
17
17
18
18
use 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 ,
23
23
} ;
24
24
use crate :: clean:: { self , GetDefId } ;
25
25
use crate :: formats:: item_type:: ItemType ;
@@ -173,7 +173,7 @@ fn toggle_close(w: &mut Buffer) {
173
173
}
174
174
175
175
fn 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 ) ;
177
177
178
178
let mut indices = ( 0 ..items. len ( ) ) . filter ( |i| !items[ * i] . is_stripped ( ) ) . collect :: < Vec < usize > > ( ) ;
179
179
@@ -485,7 +485,7 @@ fn item_function(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, f: &clean::
485
485
notable_traits = notable_traits_decl( & f. decl, cx) ,
486
486
) ;
487
487
} ) ;
488
- document ( w, cx, it, None )
488
+ document ( w, cx, it, None , 1 )
489
489
}
490
490
491
491
fn 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
608
608
} ) ;
609
609
610
610
// Trait documentation
611
- document ( w, cx, it, None ) ;
611
+ document ( w, cx, it, None , 1 ) ;
612
612
613
613
fn write_small_section_header ( w : & mut Buffer , id : & str , title : & str , extra_content : & str ) {
614
614
write ! (
@@ -626,7 +626,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
626
626
let item_type = m. type_ ( ) ;
627
627
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
628
628
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 ) ;
630
630
let toggled = !content. is_empty ( ) ;
631
631
if toggled {
632
632
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
840
840
) ;
841
841
} ) ;
842
842
843
- document ( w, cx, it, None ) ;
843
+ document ( w, cx, it, None , 1 ) ;
844
844
845
845
// Render any items associated directly to this alias, as otherwise they
846
846
// 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:
862
862
) ;
863
863
} ) ;
864
864
865
- document ( w, cx, it, None ) ;
865
+ document ( w, cx, it, None , 1 ) ;
866
866
867
867
// Render any items associated directly to this alias, as otherwise they
868
868
// won't be visible anywhere in the docs. It would be nice to also show
@@ -893,7 +893,7 @@ fn item_typedef(
893
893
) ;
894
894
} ) ;
895
895
896
- document ( w, cx, it, None ) ;
896
+ document ( w, cx, it, None , 1 ) ;
897
897
898
898
let def_id = it. def_id . expect_def_id ( ) ;
899
899
// 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
911
911
} ) ;
912
912
} ) ;
913
913
914
- document ( w, cx, it, None ) ;
914
+ document ( w, cx, it, None , 1 ) ;
915
915
916
916
let mut fields = s
917
917
. fields
@@ -944,7 +944,7 @@ fn item_union(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::Uni
944
944
if let Some ( stability_class) = field. stability_class ( cx. tcx ( ) ) {
945
945
write ! ( w, "<span class=\" stab {stab}\" ></span>" , stab = stability_class) ;
946
946
}
947
- document ( w, cx, field, Some ( it) ) ;
947
+ document ( w, cx, field, Some ( it) , 1 ) ;
948
948
}
949
949
}
950
950
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
1026
1026
} ) ;
1027
1027
} ) ;
1028
1028
1029
- document ( w, cx, it, None ) ;
1029
+ document ( w, cx, it, None , 1 ) ;
1030
1030
1031
1031
if !e. variants . is_empty ( ) {
1032
1032
write ! (
@@ -1055,7 +1055,7 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
1055
1055
w. write_str ( "</code>" ) ;
1056
1056
render_stability_since ( w, variant, it, cx. tcx ( ) ) ;
1057
1057
w. write_str ( "</div>" ) ;
1058
- document ( w, cx, variant, Some ( it) ) ;
1058
+ document ( w, cx, variant, Some ( it) , 1 ) ;
1059
1059
document_non_exhaustive ( w, variant) ;
1060
1060
1061
1061
use crate :: clean:: Variant ;
@@ -1095,7 +1095,7 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
1095
1095
f = field. name. as_ref( ) . unwrap( ) ,
1096
1096
t = ty. print( cx)
1097
1097
) ;
1098
- document ( w, cx, field, Some ( variant) ) ;
1098
+ document ( w, cx, field, Some ( variant) , 1 ) ;
1099
1099
}
1100
1100
_ => unreachable ! ( ) ,
1101
1101
}
@@ -1122,7 +1122,7 @@ fn item_macro(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Mac
1122
1122
None ,
1123
1123
) ;
1124
1124
} ) ;
1125
- document ( w, cx, it, None )
1125
+ document ( w, cx, it, None , 1 )
1126
1126
}
1127
1127
1128
1128
fn 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
1152
1152
} ) ;
1153
1153
}
1154
1154
}
1155
- document ( w, cx, it, None )
1155
+ document ( w, cx, it, None , 1 )
1156
1156
}
1157
1157
1158
1158
fn item_primitive ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item ) {
1159
- document ( w, cx, it, None ) ;
1159
+ document ( w, cx, it, None , 1 ) ;
1160
1160
render_assoc_items ( w, cx, it, it. def_id . expect_def_id ( ) , AssocItemRender :: All )
1161
1161
}
1162
1162
@@ -1195,7 +1195,7 @@ fn item_constant(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, c: &clean::
1195
1195
}
1196
1196
} ) ;
1197
1197
1198
- document ( w, cx, it, None )
1198
+ document ( w, cx, it, None , 1 )
1199
1199
}
1200
1200
1201
1201
fn 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
1206
1206
} ) ;
1207
1207
} ) ;
1208
1208
1209
- document ( w, cx, it, None ) ;
1209
+ document ( w, cx, it, None , 1 ) ;
1210
1210
1211
1211
let mut fields = s
1212
1212
. fields
@@ -1242,7 +1242,7 @@ fn item_struct(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::St
1242
1242
name = field_name,
1243
1243
ty = ty. print( cx)
1244
1244
) ;
1245
- document ( w, cx, field, Some ( it) ) ;
1245
+ document ( w, cx, field, Some ( it) , 1 ) ;
1246
1246
}
1247
1247
}
1248
1248
}
@@ -1263,7 +1263,7 @@ fn item_static(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::St
1263
1263
typ = s. type_. print( cx)
1264
1264
) ;
1265
1265
} ) ;
1266
- document ( w, cx, it, None )
1266
+ document ( w, cx, it, None , 1 )
1267
1267
}
1268
1268
1269
1269
fn 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) {
1278
1278
) ;
1279
1279
} ) ;
1280
1280
1281
- document ( w, cx, it, None ) ;
1281
+ document ( w, cx, it, None , 1 ) ;
1282
1282
1283
1283
render_assoc_items ( w, cx, it, it. def_id . expect_def_id ( ) , AssocItemRender :: All )
1284
1284
}
1285
1285
1286
1286
fn item_keyword ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item ) {
1287
- document ( w, cx, it, None )
1287
+ document ( w, cx, it, None , 1 )
1288
1288
}
1289
1289
1290
1290
/// Compare two strings treating multi-digit numbers as single units (i.e. natural sort order).
0 commit comments