@@ -247,15 +247,30 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
247247 Some ( ref src) => write ! (
248248 w,
249249 "<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( ) ) ,
252257 myitem. name. as_ref( ) . unwrap( ) ,
253258 ) ,
254259 None => write ! (
255260 w,
256261 "<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+ ) ,
259274 ) ,
260275 }
261276 w. write_str ( "</code></td></tr>" ) ;
@@ -265,7 +280,12 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
265280 write ! (
266281 w,
267282 "<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+ ) ,
269289 import. print( cx. cache( ) , cx. depth( ) )
270290 ) ;
271291 }
@@ -367,7 +387,7 @@ fn extra_info_tags(item: &clean::Item, parent: &clean::Item, tcx: TyCtxt<'_>) ->
367387fn item_function ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item , f : & clean:: Function ) {
368388 let header_len = format ! (
369389 "{}{}{}{}{:#}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 ( ) ) ,
371391 f. header. constness. print_with_space( ) ,
372392 f. header. asyncness. print_with_space( ) ,
373393 f. header. unsafety. print_with_space( ) ,
@@ -382,7 +402,7 @@ fn item_function(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, f: &clean::
382402 w,
383403 "{vis}{constness}{asyncness}{unsafety}{abi}fn \
384404 {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 ( ) ) ,
386406 constness = f. header. constness. print_with_space( ) ,
387407 asyncness = f. header. asyncness. print_with_space( ) ,
388408 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
412432 write ! (
413433 w,
414434 "{}{}{}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 ( ) ) ,
416436 t. unsafety. print_with_space( ) ,
417437 if t. is_auto { "auto " } else { "" } ,
418438 it. name. as_ref( ) . unwrap( ) ,
@@ -813,7 +833,7 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
813833 write ! (
814834 w,
815835 "{}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 ( ) ) ,
817837 it. name. as_ref( ) . unwrap( ) ,
818838 e. generics. print( cx. cache( ) , cx. depth( ) ) ,
819839 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::
9881008 write ! (
9891009 w,
9901010 "{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 ( ) ) ,
9921012 name = it. name. as_ref( ) . unwrap( ) ,
9931013 typ = c. type_. print( cx. cache( ) , cx. depth( ) ) ,
9941014 ) ;
@@ -1072,7 +1092,7 @@ fn item_static(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::St
10721092 write ! (
10731093 w,
10741094 "{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 ( ) ) ,
10761096 mutability = s. mutability. print_with_space( ) ,
10771097 name = it. name. as_ref( ) . unwrap( ) ,
10781098 typ = s. type_. print( cx. cache( ) , cx. depth( ) )
@@ -1086,7 +1106,7 @@ fn item_foreign_type(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item) {
10861106 write ! (
10871107 w,
10881108 " {}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 ( ) ) ,
10901110 it. name. as_ref( ) . unwrap( ) ,
10911111 ) ;
10921112
@@ -1250,7 +1270,7 @@ fn render_union(
12501270 write ! (
12511271 w,
12521272 "{}{}{}" ,
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 ( ) ) ,
12541274 if structhead { "union " } else { "" } ,
12551275 it. name. as_ref( ) . unwrap( )
12561276 ) ;
@@ -1269,7 +1289,7 @@ fn render_union(
12691289 write ! (
12701290 w,
12711291 " {}{}: {},\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 ( ) ) ,
12731293 field. name. as_ref( ) . unwrap( ) ,
12741294 ty. print( cx. cache( ) , cx. depth( ) ) ,
12751295 tab
@@ -1296,7 +1316,7 @@ fn render_struct(
12961316 write ! (
12971317 w,
12981318 "{}{}{}" ,
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 ( ) ) ,
13001320 if structhead { "struct " } else { "" } ,
13011321 it. name. as_ref( ) . unwrap( )
13021322 ) ;
@@ -1321,7 +1341,12 @@ fn render_struct(
13211341 w,
13221342 "\n {} {}{}: {}," ,
13231343 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+ ) ,
13251350 field. name. as_ref( ) . unwrap( ) ,
13261351 ty. print( cx. cache( ) , cx. depth( ) )
13271352 ) ;
@@ -1353,7 +1378,12 @@ fn render_struct(
13531378 write ! (
13541379 w,
13551380 "{}{}" ,
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+ ) ,
13571387 ty. print( cx. cache( ) , cx. depth( ) )
13581388 )
13591389 }
0 commit comments