@@ -1294,7 +1294,6 @@ fn render_impl(
12941294 ) {
12951295 let item_type = item. type_ ( ) ;
12961296 let name = item. name . as_ref ( ) . unwrap ( ) ;
1297- let tcx = cx. tcx ( ) ;
12981297
12991298 let render_method_item = match render_mode {
13001299 RenderMode :: Normal => true ,
@@ -1363,6 +1362,7 @@ fn render_impl(
13631362 "<div id=\" {}\" class=\" {}{} has-srclink\" >" ,
13641363 id, item_type, in_trait_class,
13651364 ) ;
1365+ render_rightside ( w, cx, item, outer_version, outer_const_version) ;
13661366 w. write_str ( "<code>" ) ;
13671367 render_assoc_item (
13681368 w,
@@ -1372,15 +1372,7 @@ fn render_impl(
13721372 cx,
13731373 ) ;
13741374 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- ) ;
13821375 write ! ( w, "<a href=\" #{}\" class=\" anchor\" ></a>" , id) ;
1383- write_srclink ( cx, item, w) ;
13841376 w. write_str ( "</div>" ) ;
13851377 }
13861378 }
@@ -1413,6 +1405,7 @@ fn render_impl(
14131405 "<div id=\" {}\" class=\" {}{} has-srclink\" ><code>" ,
14141406 id, item_type, in_trait_class
14151407 ) ;
1408+ render_rightside ( w, cx, item, outer_version, outer_const_version) ;
14161409 assoc_const (
14171410 w,
14181411 item,
@@ -1423,15 +1416,7 @@ fn render_impl(
14231416 cx,
14241417 ) ;
14251418 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- ) ;
14331419 write ! ( w, "<a href=\" #{}\" class=\" anchor\" ></a>" , id) ;
1434- write_srclink ( cx, item, w) ;
14351420 w. write_str ( "</div>" ) ;
14361421 }
14371422 clean:: AssocTypeItem ( ref bounds, ref default) => {
@@ -1590,6 +1575,28 @@ fn render_impl(
15901575 w. write_str ( & close_tags) ;
15911576}
15921577
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+
15931600pub ( crate ) fn render_impl_summary (
15941601 w : & mut Buffer ,
15951602 cx : & Context < ' _ > ,
@@ -1604,7 +1611,6 @@ pub(crate) fn render_impl_summary(
16041611 // in documentation pages for trait with automatic implementations like "Send" and "Sync".
16051612 aliases : & [ String ] ,
16061613) {
1607- let tcx = cx. tcx ( ) ;
16081614 let id = cx. derive_id ( match i. inner_impl ( ) . trait_ {
16091615 Some ( ref t) => {
16101616 if is_on_foreign_type {
@@ -1620,13 +1626,11 @@ pub(crate) fn render_impl_summary(
16201626 } else {
16211627 format ! ( " data-aliases=\" {}\" " , aliases. join( "," ) )
16221628 } ;
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+
16231633 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- ) ;
16301634 write ! ( w, "{}" , i. inner_impl( ) . print( use_absolute, cx) ) ;
16311635 if show_def_docs {
16321636 for it in & i. inner_impl ( ) . items {
@@ -1637,28 +1641,11 @@ pub(crate) fn render_impl_summary(
16371641 }
16381642 }
16391643 }
1640- w. write_str ( "</code>" ) ;
16411644 } 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) ) ;
16501646 }
1647+ write ! ( w, "</code>" ) ;
16511648 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"
16621649
16631650 let is_trait = i. inner_impl ( ) . trait_ . is_some ( ) ;
16641651 if is_trait {
0 commit comments