@@ -247,15 +247,30 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
247
247
Some ( ref src) => write ! (
248
248
w,
249
249
"<tr><td><code>{}extern crate {} as {};" ,
250
- myitem. visibility. print_with_space( cx. tcx( ) , myitem. def_id, cx. cache( ) ) ,
251
- anchor( myitem. def_id, & * src. as_str( ) , cx. cache( ) ) ,
250
+ myitem. visibility. print_with_space(
251
+ cx. tcx( ) ,
252
+ myitem. def_id,
253
+ cx. cache( ) ,
254
+ cx. depth( ) ,
255
+ ) ,
256
+ anchor( myitem. def_id, & * src. as_str( ) , cx. cache( ) , cx. depth( ) ) ,
252
257
myitem. name. as_ref( ) . unwrap( ) ,
253
258
) ,
254
259
None => write ! (
255
260
w,
256
261
"<tr><td><code>{}extern crate {};" ,
257
- myitem. visibility. print_with_space( cx. tcx( ) , myitem. def_id, cx. cache( ) ) ,
258
- anchor( myitem. def_id, & * myitem. name. as_ref( ) . unwrap( ) . as_str( ) , cx. cache( ) ) ,
262
+ myitem. visibility. print_with_space(
263
+ cx. tcx( ) ,
264
+ myitem. def_id,
265
+ cx. cache( ) ,
266
+ cx. depth( ) ,
267
+ ) ,
268
+ anchor(
269
+ myitem. def_id,
270
+ & * myitem. name. as_ref( ) . unwrap( ) . as_str( ) ,
271
+ cx. cache( ) ,
272
+ cx. depth( ) ,
273
+ ) ,
259
274
) ,
260
275
}
261
276
w. write_str ( "</code></td></tr>" ) ;
@@ -265,7 +280,12 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
265
280
write ! (
266
281
w,
267
282
"<tr><td><code>{}{}</code></td></tr>" ,
268
- myitem. visibility. print_with_space( cx. tcx( ) , myitem. def_id, cx. cache( ) ) ,
283
+ myitem. visibility. print_with_space(
284
+ cx. tcx( ) ,
285
+ myitem. def_id,
286
+ cx. cache( ) ,
287
+ cx. depth( )
288
+ ) ,
269
289
import. print( cx. cache( ) , cx. depth( ) )
270
290
) ;
271
291
}
@@ -367,7 +387,7 @@ fn extra_info_tags(item: &clean::Item, parent: &clean::Item, tcx: TyCtxt<'_>) ->
367
387
fn item_function ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item , f : & clean:: Function ) {
368
388
let header_len = format ! (
369
389
"{}{}{}{}{:#}fn {}{:#}" ,
370
- it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) ) ,
390
+ it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) , cx . depth ( ) ) ,
371
391
f. header. constness. print_with_space( ) ,
372
392
f. header. asyncness. print_with_space( ) ,
373
393
f. header. unsafety. print_with_space( ) ,
@@ -382,7 +402,7 @@ fn item_function(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, f: &clean::
382
402
w,
383
403
"{vis}{constness}{asyncness}{unsafety}{abi}fn \
384
404
{name}{generics}{decl}{spotlight}{where_clause}</pre>",
385
- vis = it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) ) ,
405
+ vis = it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) , cx . depth ( ) ) ,
386
406
constness = f. header. constness. print_with_space( ) ,
387
407
asyncness = f. header. asyncness. print_with_space( ) ,
388
408
unsafety = f. header. unsafety. print_with_space( ) ,
@@ -412,7 +432,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
412
432
write ! (
413
433
w,
414
434
"{}{}{}trait {}{}{}" ,
415
- it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) ) ,
435
+ it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) , cx . depth ( ) ) ,
416
436
t. unsafety. print_with_space( ) ,
417
437
if t. is_auto { "auto " } else { "" } ,
418
438
it. name. as_ref( ) . unwrap( ) ,
@@ -813,7 +833,7 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
813
833
write ! (
814
834
w,
815
835
"{}enum {}{}{}" ,
816
- it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) ) ,
836
+ it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) , cx . depth ( ) ) ,
817
837
it. name. as_ref( ) . unwrap( ) ,
818
838
e. generics. print( cx. cache( ) , cx. depth( ) ) ,
819
839
WhereClause { gens: & e. generics, indent: 0 , end_newline: true }
@@ -988,7 +1008,7 @@ fn item_constant(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, c: &clean::
988
1008
write ! (
989
1009
w,
990
1010
"{vis}const {name}: {typ}" ,
991
- vis = it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) ) ,
1011
+ vis = it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) , cx . depth ( ) ) ,
992
1012
name = it. name. as_ref( ) . unwrap( ) ,
993
1013
typ = c. type_. print( cx. cache( ) , cx. depth( ) ) ,
994
1014
) ;
@@ -1072,7 +1092,7 @@ fn item_static(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::St
1072
1092
write ! (
1073
1093
w,
1074
1094
"{vis}static {mutability}{name}: {typ}</pre>" ,
1075
- vis = it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) ) ,
1095
+ vis = it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) , cx . depth ( ) ) ,
1076
1096
mutability = s. mutability. print_with_space( ) ,
1077
1097
name = it. name. as_ref( ) . unwrap( ) ,
1078
1098
typ = s. type_. print( cx. cache( ) , cx. depth( ) )
@@ -1086,7 +1106,7 @@ fn item_foreign_type(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item) {
1086
1106
write ! (
1087
1107
w,
1088
1108
" {}type {};\n }}</pre>" ,
1089
- it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) ) ,
1109
+ it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) , cx . depth ( ) ) ,
1090
1110
it. name. as_ref( ) . unwrap( ) ,
1091
1111
) ;
1092
1112
@@ -1250,7 +1270,7 @@ fn render_union(
1250
1270
write ! (
1251
1271
w,
1252
1272
"{}{}{}" ,
1253
- it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) ) ,
1273
+ it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) , cx . depth ( ) ) ,
1254
1274
if structhead { "union " } else { "" } ,
1255
1275
it. name. as_ref( ) . unwrap( )
1256
1276
) ;
@@ -1269,7 +1289,7 @@ fn render_union(
1269
1289
write ! (
1270
1290
w,
1271
1291
" {}{}: {},\n {}" ,
1272
- field. visibility. print_with_space( cx. tcx( ) , field. def_id, cx. cache( ) ) ,
1292
+ field. visibility. print_with_space( cx. tcx( ) , field. def_id, cx. cache( ) , cx . depth ( ) ) ,
1273
1293
field. name. as_ref( ) . unwrap( ) ,
1274
1294
ty. print( cx. cache( ) , cx. depth( ) ) ,
1275
1295
tab
@@ -1296,7 +1316,7 @@ fn render_struct(
1296
1316
write ! (
1297
1317
w,
1298
1318
"{}{}{}" ,
1299
- it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) ) ,
1319
+ it. visibility. print_with_space( cx. tcx( ) , it. def_id, cx. cache( ) , cx . depth ( ) ) ,
1300
1320
if structhead { "struct " } else { "" } ,
1301
1321
it. name. as_ref( ) . unwrap( )
1302
1322
) ;
@@ -1321,7 +1341,12 @@ fn render_struct(
1321
1341
w,
1322
1342
"\n {} {}{}: {}," ,
1323
1343
tab,
1324
- field. visibility. print_with_space( cx. tcx( ) , field. def_id, cx. cache( ) ) ,
1344
+ field. visibility. print_with_space(
1345
+ cx. tcx( ) ,
1346
+ field. def_id,
1347
+ cx. cache( ) ,
1348
+ cx. depth( )
1349
+ ) ,
1325
1350
field. name. as_ref( ) . unwrap( ) ,
1326
1351
ty. print( cx. cache( ) , cx. depth( ) )
1327
1352
) ;
@@ -1353,7 +1378,12 @@ fn render_struct(
1353
1378
write ! (
1354
1379
w,
1355
1380
"{}{}" ,
1356
- field. visibility. print_with_space( cx. tcx( ) , field. def_id, cx. cache( ) ) ,
1381
+ field. visibility. print_with_space(
1382
+ cx. tcx( ) ,
1383
+ field. def_id,
1384
+ cx. cache( ) ,
1385
+ cx. depth( )
1386
+ ) ,
1357
1387
ty. print( cx. cache( ) , cx. depth( ) )
1358
1388
)
1359
1389
}
0 commit comments