@@ -2157,14 +2157,14 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
2157
2157
Some ( ref src) => write ! (
2158
2158
w,
2159
2159
"<tr><td><code>{}extern crate {} as {};" ,
2160
- myitem. visibility. print_with_space( cx. tcx( ) ) ,
2160
+ myitem. visibility. print_with_space( cx. tcx( ) , myitem . def_id ) ,
2161
2161
anchor( myitem. def_id, & * src. as_str( ) ) ,
2162
2162
name
2163
2163
) ,
2164
2164
None => write ! (
2165
2165
w,
2166
2166
"<tr><td><code>{}extern crate {};" ,
2167
- myitem. visibility. print_with_space( cx. tcx( ) ) ,
2167
+ myitem. visibility. print_with_space( cx. tcx( ) , myitem . def_id ) ,
2168
2168
anchor( myitem. def_id, & * name. as_str( ) )
2169
2169
) ,
2170
2170
}
@@ -2175,7 +2175,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
2175
2175
write ! (
2176
2176
w,
2177
2177
"<tr><td><code>{}{}</code></td></tr>" ,
2178
- myitem. visibility. print_with_space( cx. tcx( ) ) ,
2178
+ myitem. visibility. print_with_space( cx. tcx( ) , myitem . def_id ) ,
2179
2179
import. print( )
2180
2180
) ;
2181
2181
}
@@ -2392,7 +2392,7 @@ fn item_constant(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, c: &clean::
2392
2392
write ! (
2393
2393
w,
2394
2394
"{vis}const {name}: {typ}" ,
2395
- vis = it. visibility. print_with_space( cx. tcx( ) ) ,
2395
+ vis = it. visibility. print_with_space( cx. tcx( ) , it . def_id ) ,
2396
2396
name = it. name. as_ref( ) . unwrap( ) ,
2397
2397
typ = c. type_. print( ) ,
2398
2398
) ;
@@ -2426,7 +2426,7 @@ fn item_static(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::St
2426
2426
write ! (
2427
2427
w,
2428
2428
"{vis}static {mutability}{name}: {typ}</pre>" ,
2429
- vis = it. visibility. print_with_space( cx. tcx( ) ) ,
2429
+ vis = it. visibility. print_with_space( cx. tcx( ) , it . def_id ) ,
2430
2430
mutability = s. mutability. print_with_space( ) ,
2431
2431
name = it. name. as_ref( ) . unwrap( ) ,
2432
2432
typ = s. type_. print( )
@@ -2437,7 +2437,7 @@ fn item_static(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::St
2437
2437
fn item_function ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item , f : & clean:: Function ) {
2438
2438
let header_len = format ! (
2439
2439
"{}{}{}{}{:#}fn {}{:#}" ,
2440
- it. visibility. print_with_space( cx. tcx( ) ) ,
2440
+ it. visibility. print_with_space( cx. tcx( ) , it . def_id ) ,
2441
2441
f. header. constness. print_with_space( ) ,
2442
2442
f. header. asyncness. print_with_space( ) ,
2443
2443
f. header. unsafety. print_with_space( ) ,
@@ -2452,7 +2452,7 @@ fn item_function(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, f: &clean::
2452
2452
w,
2453
2453
"{vis}{constness}{asyncness}{unsafety}{abi}fn \
2454
2454
{name}{generics}{decl}{spotlight}{where_clause}</pre>",
2455
- vis = it. visibility. print_with_space( cx. tcx( ) ) ,
2455
+ vis = it. visibility. print_with_space( cx. tcx( ) , it . def_id ) ,
2456
2456
constness = f. header. constness. print_with_space( ) ,
2457
2457
asyncness = f. header. asyncness. print_with_space( ) ,
2458
2458
unsafety = f. header. unsafety. print_with_space( ) ,
@@ -2578,7 +2578,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
2578
2578
write ! (
2579
2579
w,
2580
2580
"{}{}{}trait {}{}{}" ,
2581
- it. visibility. print_with_space( cx. tcx( ) ) ,
2581
+ it. visibility. print_with_space( cx. tcx( ) , it . def_id ) ,
2582
2582
t. unsafety. print_with_space( ) ,
2583
2583
if t. is_auto { "auto " } else { "" } ,
2584
2584
it. name. as_ref( ) . unwrap( ) ,
@@ -2896,7 +2896,7 @@ fn assoc_const(
2896
2896
w,
2897
2897
"{}{}const <a href=\" {}\" class=\" constant\" ><b>{}</b></a>: {}" ,
2898
2898
extra,
2899
- it. visibility. print_with_space( cx. tcx( ) ) ,
2899
+ it. visibility. print_with_space( cx. tcx( ) , it . def_id ) ,
2900
2900
naive_assoc_href( it, link) ,
2901
2901
it. name. as_ref( ) . unwrap( ) ,
2902
2902
ty. print( )
@@ -3015,7 +3015,7 @@ fn render_assoc_item(
3015
3015
} ;
3016
3016
let mut header_len = format ! (
3017
3017
"{}{}{}{}{}{:#}fn {}{:#}" ,
3018
- meth. visibility. print_with_space( cx. tcx( ) ) ,
3018
+ meth. visibility. print_with_space( cx. tcx( ) , meth . def_id ) ,
3019
3019
header. constness. print_with_space( ) ,
3020
3020
header. asyncness. print_with_space( ) ,
3021
3021
header. unsafety. print_with_space( ) ,
@@ -3037,7 +3037,7 @@ fn render_assoc_item(
3037
3037
"{}{}{}{}{}{}{}fn <a href=\" {href}\" class=\" fnname\" >{name}</a>\
3038
3038
{generics}{decl}{spotlight}{where_clause}",
3039
3039
if parent == ItemType :: Trait { " " } else { "" } ,
3040
- meth. visibility. print_with_space( cx. tcx( ) ) ,
3040
+ meth. visibility. print_with_space( cx. tcx( ) , meth . def_id ) ,
3041
3041
header. constness. print_with_space( ) ,
3042
3042
header. asyncness. print_with_space( ) ,
3043
3043
header. unsafety. print_with_space( ) ,
@@ -3189,7 +3189,7 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
3189
3189
write ! (
3190
3190
w,
3191
3191
"{}enum {}{}{}" ,
3192
- it. visibility. print_with_space( cx. tcx( ) ) ,
3192
+ it. visibility. print_with_space( cx. tcx( ) , it . def_id ) ,
3193
3193
it. name. as_ref( ) . unwrap( ) ,
3194
3194
e. generics. print( ) ,
3195
3195
WhereClause { gens: & e. generics, indent: 0 , end_newline: true }
@@ -3365,7 +3365,7 @@ fn render_struct(
3365
3365
write ! (
3366
3366
w,
3367
3367
"{}{}{}" ,
3368
- it. visibility. print_with_space( cx. tcx( ) ) ,
3368
+ it. visibility. print_with_space( cx. tcx( ) , it . def_id ) ,
3369
3369
if structhead { "struct " } else { "" } ,
3370
3370
it. name. as_ref( ) . unwrap( )
3371
3371
) ;
@@ -3385,7 +3385,7 @@ fn render_struct(
3385
3385
w,
3386
3386
"\n {} {}{}: {}," ,
3387
3387
tab,
3388
- field. visibility. print_with_space( cx. tcx( ) ) ,
3388
+ field. visibility. print_with_space( cx. tcx( ) , field . def_id ) ,
3389
3389
field. name. as_ref( ) . unwrap( ) ,
3390
3390
ty. print( )
3391
3391
) ;
@@ -3414,7 +3414,12 @@ fn render_struct(
3414
3414
match * field. kind {
3415
3415
clean:: StrippedItem ( box clean:: StructFieldItem ( ..) ) => write ! ( w, "_" ) ,
3416
3416
clean:: StructFieldItem ( ref ty) => {
3417
- write ! ( w, "{}{}" , field. visibility. print_with_space( cx. tcx( ) ) , ty. print( ) )
3417
+ write ! (
3418
+ w,
3419
+ "{}{}" ,
3420
+ field. visibility. print_with_space( cx. tcx( ) , field. def_id) ,
3421
+ ty. print( )
3422
+ )
3418
3423
}
3419
3424
_ => unreachable ! ( ) ,
3420
3425
}
@@ -3447,7 +3452,7 @@ fn render_union(
3447
3452
write ! (
3448
3453
w,
3449
3454
"{}{}{}" ,
3450
- it. visibility. print_with_space( cx. tcx( ) ) ,
3455
+ it. visibility. print_with_space( cx. tcx( ) , it . def_id ) ,
3451
3456
if structhead { "union " } else { "" } ,
3452
3457
it. name. as_ref( ) . unwrap( )
3453
3458
) ;
@@ -3462,7 +3467,7 @@ fn render_union(
3462
3467
write ! (
3463
3468
w,
3464
3469
" {}{}: {},\n {}" ,
3465
- field. visibility. print_with_space( cx. tcx( ) ) ,
3470
+ field. visibility. print_with_space( cx. tcx( ) , field . def_id ) ,
3466
3471
field. name. as_ref( ) . unwrap( ) ,
3467
3472
ty. print( ) ,
3468
3473
tab
@@ -4101,7 +4106,7 @@ fn item_foreign_type(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, cache:
4101
4106
write ! (
4102
4107
w,
4103
4108
" {}type {};\n }}</pre>" ,
4104
- it. visibility. print_with_space( cx. tcx( ) ) ,
4109
+ it. visibility. print_with_space( cx. tcx( ) , it . def_id ) ,
4105
4110
it. name. as_ref( ) . unwrap( ) ,
4106
4111
) ;
4107
4112
0 commit comments