@@ -245,7 +245,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
245245 // (which is the position in the vector).
246246 indices. dedup_by_key ( |i| {
247247 (
248- items[ * i] . def_id ,
248+ items[ * i] . def_id . clone ( ) ,
249249 if items[ * i] . name . as_ref ( ) . is_some ( ) { Some ( full_path ( cx, & items[ * i] ) ) } else { None } ,
250250 items[ * i] . type_ ( ) ,
251251 if items[ * i] . is_import ( ) { * i } else { 0 } ,
@@ -288,14 +288,14 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
288288 Some ( ref src) => write ! (
289289 w,
290290 "<div class=\" item-left\" ><code>{}extern crate {} as {};" ,
291- myitem. visibility. print_with_space( myitem. def_id, cx) ,
291+ myitem. visibility. print_with_space( myitem. def_id. clone ( ) , cx) ,
292292 anchor( myitem. def_id. expect_def_id( ) , & * src. as_str( ) , cx) ,
293293 myitem. name. as_ref( ) . unwrap( ) ,
294294 ) ,
295295 None => write ! (
296296 w,
297297 "<div class=\" item-left\" ><code>{}extern crate {};" ,
298- myitem. visibility. print_with_space( myitem. def_id, cx) ,
298+ myitem. visibility. print_with_space( myitem. def_id. clone ( ) , cx) ,
299299 anchor(
300300 myitem. def_id. expect_def_id( ) ,
301301 & * myitem. name. as_ref( ) . unwrap( ) . as_str( ) ,
@@ -336,7 +336,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
336336 <div class=\" item-right docblock-short\" >{stab_tags}</div>",
337337 stab = stab. unwrap_or_default( ) ,
338338 add = add,
339- vis = myitem. visibility. print_with_space( myitem. def_id, cx) ,
339+ vis = myitem. visibility. print_with_space( myitem. def_id. clone ( ) , cx) ,
340340 imp = import. print( cx) ,
341341 stab_tags = stab_tags. unwrap_or_default( ) ,
342342 ) ;
@@ -437,7 +437,7 @@ fn extra_info_tags(item: &clean::Item, parent: &clean::Item, tcx: TyCtxt<'_>) ->
437437}
438438
439439fn item_function ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item , f : & clean:: Function ) {
440- let vis = it. visibility . print_with_space ( it. def_id , cx) . to_string ( ) ;
440+ let vis = it. visibility . print_with_space ( it. def_id . clone ( ) , cx) . to_string ( ) ;
441441 let constness = print_constness_with_space ( & f. header . constness , it. const_stability ( cx. tcx ( ) ) ) ;
442442 let asyncness = f. header . asyncness . print_with_space ( ) ;
443443 let unsafety = f. header . unsafety . print_with_space ( ) ;
@@ -489,7 +489,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
489489 write ! (
490490 w,
491491 "{}{}{}trait {}{}{}" ,
492- it. visibility. print_with_space( it. def_id, cx) ,
492+ it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
493493 t. unsafety. print_with_space( ) ,
494494 if t. is_auto { "auto " } else { "" } ,
495495 it. name. as_ref( ) . unwrap( ) ,
@@ -710,8 +710,10 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
710710
711711 for implementor in foreign {
712712 let provided_methods = implementor. inner_impl ( ) . provided_trait_methods ( cx. tcx ( ) ) ;
713- let assoc_link =
714- AssocItemLink :: GotoSource ( implementor. impl_item . def_id , & provided_methods) ;
713+ let assoc_link = AssocItemLink :: GotoSource (
714+ implementor. impl_item . def_id . clone ( ) ,
715+ & provided_methods,
716+ ) ;
715717 render_impl (
716718 w,
717719 cx,
@@ -915,7 +917,7 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
915917 write ! (
916918 w,
917919 "{}enum {}{}{}" ,
918- it. visibility. print_with_space( it. def_id, cx) ,
920+ it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
919921 it. name. as_ref( ) . unwrap( ) ,
920922 e. generics. print( cx) ,
921923 print_where_clause( & e. generics, cx, 0 , true ) ,
@@ -1103,7 +1105,7 @@ fn item_constant(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, c: &clean::
11031105 write ! (
11041106 w,
11051107 "{vis}const {name}: {typ}" ,
1106- vis = it. visibility. print_with_space( it. def_id, cx) ,
1108+ vis = it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
11071109 name = it. name. as_ref( ) . unwrap( ) ,
11081110 typ = c. type_. print( cx) ,
11091111 ) ;
@@ -1193,7 +1195,7 @@ fn item_static(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::St
11931195 write ! (
11941196 w,
11951197 "{vis}static {mutability}{name}: {typ}</pre>" ,
1196- vis = it. visibility. print_with_space( it. def_id, cx) ,
1198+ vis = it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
11971199 mutability = s. mutability. print_with_space( ) ,
11981200 name = it. name. as_ref( ) . unwrap( ) ,
11991201 typ = s. type_. print( cx)
@@ -1207,7 +1209,7 @@ fn item_foreign_type(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item) {
12071209 write ! (
12081210 w,
12091211 " {}type {};\n }}</pre>" ,
1210- it. visibility. print_with_space( it. def_id, cx) ,
1212+ it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
12111213 it. name. as_ref( ) . unwrap( ) ,
12121214 ) ;
12131215
@@ -1362,7 +1364,7 @@ fn render_union(
13621364 write ! (
13631365 w,
13641366 "{}{}{}" ,
1365- it. visibility. print_with_space( it. def_id, cx) ,
1367+ it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
13661368 if structhead { "union " } else { "" } ,
13671369 it. name. as_ref( ) . unwrap( )
13681370 ) ;
@@ -1384,7 +1386,7 @@ fn render_union(
13841386 write ! (
13851387 w,
13861388 " {}{}: {},\n {}" ,
1387- field. visibility. print_with_space( field. def_id, cx) ,
1389+ field. visibility. print_with_space( field. def_id. clone ( ) , cx) ,
13881390 field. name. as_ref( ) . unwrap( ) ,
13891391 ty. print( cx) ,
13901392 tab
@@ -1414,7 +1416,7 @@ fn render_struct(
14141416 write ! (
14151417 w,
14161418 "{}{}{}" ,
1417- it. visibility. print_with_space( it. def_id, cx) ,
1419+ it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
14181420 if structhead { "struct " } else { "" } ,
14191421 it. name. as_ref( ) . unwrap( )
14201422 ) ;
@@ -1440,7 +1442,7 @@ fn render_struct(
14401442 w,
14411443 "\n {} {}{}: {}," ,
14421444 tab,
1443- field. visibility. print_with_space( field. def_id, cx) ,
1445+ field. visibility. print_with_space( field. def_id. clone ( ) , cx) ,
14441446 field. name. as_ref( ) . unwrap( ) ,
14451447 ty. print( cx) ,
14461448 ) ;
@@ -1474,7 +1476,7 @@ fn render_struct(
14741476 write ! (
14751477 w,
14761478 "{}{}" ,
1477- field. visibility. print_with_space( field. def_id, cx) ,
1479+ field. visibility. print_with_space( field. def_id. clone ( ) , cx) ,
14781480 ty. print( cx) ,
14791481 )
14801482 }
0 commit comments