@@ -1453,12 +1453,13 @@ fn render_impl(
1453
1453
} else {
1454
1454
( true , " hidden" )
1455
1455
} ;
1456
+ let in_trait_class = if trait_. is_some ( ) { " trait-impl" } else { "" } ;
1456
1457
match * item. kind {
1457
1458
clean:: MethodItem ( ..) | clean:: TyMethodItem ( _) => {
1458
1459
// Only render when the method is not static or we allow static methods
1459
1460
if render_method_item {
1460
1461
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
1461
- write ! ( w, "<h4 id=\" {}\" class=\" {}{}\" >" , id, item_type, extra_class) ;
1462
+ write ! ( w, "<h4 id=\" {}\" class=\" {}{}{} \" >" , id, item_type, extra_class, in_trait_class ) ;
1462
1463
w. write_str ( "<code>" ) ;
1463
1464
render_assoc_item ( w, item, link. anchor ( & id) , ItemType :: Impl , cx) ;
1464
1465
w. write_str ( "</code>" ) ;
@@ -1469,13 +1470,14 @@ fn render_impl(
1469
1470
outer_version,
1470
1471
outer_const_version,
1471
1472
) ;
1473
+ write ! ( w, "<a href=\" #{}\" class=\" anchor\" ></a>" , id) ;
1472
1474
write_srclink ( cx, item, w) ;
1473
1475
w. write_str ( "</h4>" ) ;
1474
1476
}
1475
1477
}
1476
1478
clean:: TypedefItem ( ref tydef, _) => {
1477
1479
let id = cx. derive_id ( format ! ( "{}.{}" , ItemType :: AssocType , name) ) ;
1478
- write ! ( w, "<h4 id=\" {}\" class=\" {}{}\" ><code>" , id, item_type, extra_class) ;
1480
+ write ! ( w, "<h4 id=\" {}\" class=\" {}{}{} \" ><code>" , id, item_type, extra_class, in_trait_class ) ;
1479
1481
assoc_type (
1480
1482
w,
1481
1483
item,
@@ -1486,11 +1488,13 @@ fn render_impl(
1486
1488
cx. cache ( ) ,
1487
1489
tcx,
1488
1490
) ;
1489
- w. write_str ( "</code></h4>" ) ;
1491
+ w. write_str ( "</code>" ) ;
1492
+ write ! ( w, "<a href=\" #{}\" class=\" anchor\" ></a>" , id) ;
1493
+ w. write_str ( "</h4>" ) ;
1490
1494
}
1491
1495
clean:: AssocConstItem ( ref ty, ref default) => {
1492
1496
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
1493
- write ! ( w, "<h4 id=\" {}\" class=\" {}{}\" ><code>" , id, item_type, extra_class) ;
1497
+ write ! ( w, "<h4 id=\" {}\" class=\" {}{}{} \" ><code>" , id, item_type, extra_class, in_trait_class ) ;
1494
1498
assoc_const ( w, item, ty, default. as_ref ( ) , link. anchor ( & id) , "" , cx) ;
1495
1499
w. write_str ( "</code>" ) ;
1496
1500
render_stability_since_raw (
@@ -1500,12 +1504,13 @@ fn render_impl(
1500
1504
outer_version,
1501
1505
outer_const_version,
1502
1506
) ;
1507
+ write ! ( w, "<a href=\" #{}\" class=\" anchor\" ></a>" , id) ;
1503
1508
write_srclink ( cx, item, w) ;
1504
1509
w. write_str ( "</h4>" ) ;
1505
1510
}
1506
1511
clean:: AssocTypeItem ( ref bounds, ref default) => {
1507
1512
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
1508
- write ! ( w, "<h4 id=\" {}\" class=\" {}{}\" ><code>" , id, item_type, extra_class) ;
1513
+ write ! ( w, "<h4 id=\" {}\" class=\" {}{}{} \" ><code>" , id, item_type, extra_class, in_trait_class ) ;
1509
1514
assoc_type (
1510
1515
w,
1511
1516
item,
@@ -1516,7 +1521,9 @@ fn render_impl(
1516
1521
cx. cache ( ) ,
1517
1522
tcx,
1518
1523
) ;
1519
- w. write_str ( "</code></h4>" ) ;
1524
+ w. write_str ( "</code>" ) ;
1525
+ write ! ( w, "<a href=\" #{}\" class=\" anchor\" ></a>" , id) ;
1526
+ w. write_str ( "</h4>" ) ;
1520
1527
}
1521
1528
clean:: StrippedItem ( ..) => return ,
1522
1529
_ => panic ! ( "can't make docs for trait item with name {:?}" , item. name) ,
0 commit comments