@@ -1294,7 +1294,6 @@ fn render_impl(
1294
1294
) {
1295
1295
let item_type = item. type_ ( ) ;
1296
1296
let name = item. name . as_ref ( ) . unwrap ( ) ;
1297
- let tcx = cx. tcx ( ) ;
1298
1297
1299
1298
let render_method_item = match render_mode {
1300
1299
RenderMode :: Normal => true ,
@@ -1363,6 +1362,7 @@ fn render_impl(
1363
1362
"<div id=\" {}\" class=\" {}{} has-srclink\" >" ,
1364
1363
id, item_type, in_trait_class,
1365
1364
) ;
1365
+ render_rightside ( w, cx, item, outer_version, outer_const_version) ;
1366
1366
w. write_str ( "<code>" ) ;
1367
1367
render_assoc_item (
1368
1368
w,
@@ -1372,15 +1372,7 @@ fn render_impl(
1372
1372
cx,
1373
1373
) ;
1374
1374
w. write_str ( "</code>" ) ;
1375
- render_stability_since_raw (
1376
- w,
1377
- item. stable_since ( tcx) . as_deref ( ) ,
1378
- item. const_stable_since ( tcx) . as_deref ( ) ,
1379
- outer_version,
1380
- outer_const_version,
1381
- ) ;
1382
1375
write ! ( w, "<a href=\" #{}\" class=\" anchor\" ></a>" , id) ;
1383
- write_srclink ( cx, item, w) ;
1384
1376
w. write_str ( "</div>" ) ;
1385
1377
}
1386
1378
}
@@ -1413,6 +1405,7 @@ fn render_impl(
1413
1405
"<div id=\" {}\" class=\" {}{} has-srclink\" ><code>" ,
1414
1406
id, item_type, in_trait_class
1415
1407
) ;
1408
+ render_rightside ( w, cx, item, outer_version, outer_const_version) ;
1416
1409
assoc_const (
1417
1410
w,
1418
1411
item,
@@ -1423,15 +1416,7 @@ fn render_impl(
1423
1416
cx,
1424
1417
) ;
1425
1418
w. write_str ( "</code>" ) ;
1426
- render_stability_since_raw (
1427
- w,
1428
- item. stable_since ( tcx) . as_deref ( ) ,
1429
- item. const_stable_since ( tcx) . as_deref ( ) ,
1430
- outer_version,
1431
- outer_const_version,
1432
- ) ;
1433
1419
write ! ( w, "<a href=\" #{}\" class=\" anchor\" ></a>" , id) ;
1434
- write_srclink ( cx, item, w) ;
1435
1420
w. write_str ( "</div>" ) ;
1436
1421
}
1437
1422
clean:: AssocTypeItem ( ref bounds, ref default) => {
@@ -1590,6 +1575,28 @@ fn render_impl(
1590
1575
w. write_str ( & close_tags) ;
1591
1576
}
1592
1577
1578
+ fn render_rightside (
1579
+ w : & mut Buffer ,
1580
+ cx : & Context < ' _ > ,
1581
+ item : & clean:: Item ,
1582
+ outer_version : Option < & str > ,
1583
+ outer_const_version : Option < & str > ,
1584
+ ) {
1585
+ let tcx = cx. tcx ( ) ;
1586
+
1587
+ write ! ( w, "<div class=\" rightside\" >" ) ;
1588
+ render_stability_since_raw (
1589
+ w,
1590
+ item. stable_since ( tcx) . as_deref ( ) ,
1591
+ item. const_stable_since ( tcx) . as_deref ( ) ,
1592
+ outer_version,
1593
+ outer_const_version,
1594
+ ) ;
1595
+
1596
+ write_srclink ( cx, item, w) ;
1597
+ w. write_str ( "</div>" ) ;
1598
+ }
1599
+
1593
1600
pub ( crate ) fn render_impl_summary (
1594
1601
w : & mut Buffer ,
1595
1602
cx : & Context < ' _ > ,
@@ -1604,7 +1611,6 @@ pub(crate) fn render_impl_summary(
1604
1611
// in documentation pages for trait with automatic implementations like "Send" and "Sync".
1605
1612
aliases : & [ String ] ,
1606
1613
) {
1607
- let tcx = cx. tcx ( ) ;
1608
1614
let id = cx. derive_id ( match i. inner_impl ( ) . trait_ {
1609
1615
Some ( ref t) => {
1610
1616
if is_on_foreign_type {
@@ -1620,13 +1626,11 @@ pub(crate) fn render_impl_summary(
1620
1626
} else {
1621
1627
format ! ( " data-aliases=\" {}\" " , aliases. join( "," ) )
1622
1628
} ;
1629
+ write ! ( w, "<div id=\" {}\" class=\" impl has-srclink\" {}>" , id, aliases) ;
1630
+ render_rightside ( w, cx, & i. impl_item , outer_version, outer_const_version) ;
1631
+ write ! ( w, "<code class=\" in-band\" >" ) ;
1632
+
1623
1633
if let Some ( use_absolute) = use_absolute {
1624
- write ! (
1625
- w,
1626
- "<div id=\" {}\" class=\" impl has-srclink\" {}>\
1627
- <code class=\" in-band\" >",
1628
- id, aliases
1629
- ) ;
1630
1634
write ! ( w, "{}" , i. inner_impl( ) . print( use_absolute, cx) ) ;
1631
1635
if show_def_docs {
1632
1636
for it in & i. inner_impl ( ) . items {
@@ -1637,28 +1641,11 @@ pub(crate) fn render_impl_summary(
1637
1641
}
1638
1642
}
1639
1643
}
1640
- w. write_str ( "</code>" ) ;
1641
1644
} else {
1642
- write ! (
1643
- w,
1644
- "<div id=\" {}\" class=\" impl has-srclink\" {}>\
1645
- <code class=\" in-band\" >{}</code>",
1646
- id,
1647
- aliases,
1648
- i. inner_impl( ) . print( false , cx)
1649
- ) ;
1645
+ write ! ( w, "{}" , i. inner_impl( ) . print( false , cx) ) ;
1650
1646
}
1647
+ write ! ( w, "</code>" ) ;
1651
1648
write ! ( w, "<a href=\" #{}\" class=\" anchor\" ></a>" , id) ;
1652
- write ! ( w, "<div class=\" rightside\" >" ) ;
1653
- render_stability_since_raw (
1654
- w,
1655
- i. impl_item . stable_since ( tcx) . as_deref ( ) ,
1656
- i. impl_item . const_stable_since ( tcx) . as_deref ( ) ,
1657
- outer_version,
1658
- outer_const_version,
1659
- ) ;
1660
- write_srclink ( cx, & i. impl_item , w) ;
1661
- w. write_str ( "</div>" ) ; // end of "rightside"
1662
1649
1663
1650
let is_trait = i. inner_impl ( ) . trait_ . is_some ( ) ;
1664
1651
if is_trait {
0 commit comments