@@ -1265,7 +1265,7 @@ fn notable_traits_decl(decl: &clean::FnDecl, cx: &Context<'_>) -> String {
1265
1265
if out. is_empty ( ) {
1266
1266
write ! (
1267
1267
& mut out,
1268
- "<div class=\" notable\" >Notable traits for {}</div >\
1268
+ "<span class=\" notable\" >Notable traits for {}</span >\
1269
1269
<code class=\" content\" >",
1270
1270
impl_. for_. print( cx)
1271
1271
) ;
@@ -1297,9 +1297,9 @@ fn notable_traits_decl(decl: &clean::FnDecl, cx: &Context<'_>) -> String {
1297
1297
out. insert_str (
1298
1298
0 ,
1299
1299
"<span class=\" notable-traits\" ><span class=\" notable-traits-tooltip\" >ⓘ\
1300
- <div class=\" notable-traits-tooltiptext\" ><span class=\" docblock\" >",
1300
+ <span class=\" notable-traits-tooltiptext\" ><span class=\" docblock\" >",
1301
1301
) ;
1302
- out. push_str ( "</code></span></div ></span></span>" ) ;
1302
+ out. push_str ( "</code></span></span ></span></span>" ) ;
1303
1303
}
1304
1304
1305
1305
out. into_inner ( )
@@ -1431,7 +1431,7 @@ fn render_impl(
1431
1431
. map ( |item| format ! ( "{}.{}" , item. type_( ) , name) ) ;
1432
1432
write ! (
1433
1433
w,
1434
- "<div id=\" {}\" class=\" {}{} has-srclink\" >" ,
1434
+ "<section id=\" {}\" class=\" {}{} has-srclink\" >" ,
1435
1435
id, item_type, in_trait_class,
1436
1436
) ;
1437
1437
render_rightside ( w, cx, item, containing_item, render_mode) ;
@@ -1446,15 +1446,15 @@ fn render_impl(
1446
1446
render_mode,
1447
1447
) ;
1448
1448
w. write_str ( "</h4>" ) ;
1449
- w. write_str ( "</div >" ) ;
1449
+ w. write_str ( "</section >" ) ;
1450
1450
}
1451
1451
}
1452
1452
clean:: TypedefItem ( ref tydef, _) => {
1453
1453
let source_id = format ! ( "{}.{}" , ItemType :: AssocType , name) ;
1454
1454
let id = cx. derive_id ( source_id. clone ( ) ) ;
1455
1455
write ! (
1456
1456
w,
1457
- "<div id=\" {}\" class=\" {}{} has-srclink\" >" ,
1457
+ "<section id=\" {}\" class=\" {}{} has-srclink\" >" ,
1458
1458
id, item_type, in_trait_class
1459
1459
) ;
1460
1460
write ! ( w, "<a href=\" #{}\" class=\" anchor\" ></a>" , id) ;
@@ -1469,14 +1469,14 @@ fn render_impl(
1469
1469
cx,
1470
1470
) ;
1471
1471
w. write_str ( "</h4>" ) ;
1472
- w. write_str ( "</div >" ) ;
1472
+ w. write_str ( "</section >" ) ;
1473
1473
}
1474
1474
clean:: AssocConstItem ( ref ty, _) => {
1475
1475
let source_id = format ! ( "{}.{}" , item_type, name) ;
1476
1476
let id = cx. derive_id ( source_id. clone ( ) ) ;
1477
1477
write ! (
1478
1478
w,
1479
- "<div id=\" {}\" class=\" {}{} has-srclink\" >" ,
1479
+ "<section id=\" {}\" class=\" {}{} has-srclink\" >" ,
1480
1480
id, item_type, in_trait_class
1481
1481
) ;
1482
1482
render_rightside ( w, cx, item, containing_item, render_mode) ;
@@ -1491,12 +1491,12 @@ fn render_impl(
1491
1491
cx,
1492
1492
) ;
1493
1493
w. write_str ( "</h4>" ) ;
1494
- w. write_str ( "</div >" ) ;
1494
+ w. write_str ( "</section >" ) ;
1495
1495
}
1496
1496
clean:: AssocTypeItem ( ref bounds, ref default) => {
1497
1497
let source_id = format ! ( "{}.{}" , item_type, name) ;
1498
1498
let id = cx. derive_id ( source_id. clone ( ) ) ;
1499
- write ! ( w, "<div id=\" {}\" class=\" {}{}\" >" , id, item_type, in_trait_class, ) ;
1499
+ write ! ( w, "<section id=\" {}\" class=\" {}{}\" >" , id, item_type, in_trait_class, ) ;
1500
1500
write ! ( w, "<a href=\" #{}\" class=\" anchor\" ></a>" , id) ;
1501
1501
w. write_str ( "<h4 class=\" code-header\" >" ) ;
1502
1502
assoc_type (
@@ -1509,7 +1509,7 @@ fn render_impl(
1509
1509
cx,
1510
1510
) ;
1511
1511
w. write_str ( "</h4>" ) ;
1512
- w. write_str ( "</div >" ) ;
1512
+ w. write_str ( "</section >" ) ;
1513
1513
}
1514
1514
clean:: StrippedItem ( ..) => return ,
1515
1515
_ => panic ! ( "can't make docs for trait item with name {:?}" , item. name) ,
@@ -1668,21 +1668,23 @@ fn render_rightside(
1668
1668
RenderMode :: ForDeref { .. } => ( None , None ) ,
1669
1669
} ;
1670
1670
1671
- write ! ( w , "<div class= \" rightside\" >" ) ;
1671
+ let mut rightside = Buffer :: new ( ) ;
1672
1672
let has_stability = render_stability_since_raw (
1673
- w ,
1673
+ & mut rightside ,
1674
1674
item. stable_since ( tcx) ,
1675
1675
const_stability,
1676
1676
containing_item. stable_since ( tcx) ,
1677
1677
const_stable_since,
1678
1678
) ;
1679
- let mut tmp_buf = Buffer :: empty_from ( w) ;
1680
- write_srclink ( cx, item, & mut tmp_buf) ;
1681
- if has_stability && !tmp_buf. is_empty ( ) {
1682
- w. write_str ( " · " ) ;
1679
+ let mut srclink = Buffer :: empty_from ( w) ;
1680
+ write_srclink ( cx, item, & mut srclink) ;
1681
+ if has_stability && !srclink. is_empty ( ) {
1682
+ rightside. write_str ( " · " ) ;
1683
+ }
1684
+ rightside. push_buffer ( srclink) ;
1685
+ if !rightside. is_empty ( ) {
1686
+ write ! ( w, "<span class=\" rightside\" >{}</span>" , rightside. into_inner( ) ) ;
1683
1687
}
1684
- w. push_buffer ( tmp_buf) ;
1685
- w. write_str ( "</div>" ) ;
1686
1688
}
1687
1689
1688
1690
pub ( crate ) fn render_impl_summary (
@@ -1713,7 +1715,7 @@ pub(crate) fn render_impl_summary(
1713
1715
} else {
1714
1716
format ! ( " data-aliases=\" {}\" " , aliases. join( "," ) )
1715
1717
} ;
1716
- write ! ( w, "<div id=\" {}\" class=\" impl has-srclink\" {}>" , id, aliases) ;
1718
+ write ! ( w, "<section id=\" {}\" class=\" impl has-srclink\" {}>" , id, aliases) ;
1717
1719
render_rightside ( w, cx, & i. impl_item , containing_item, RenderMode :: Normal ) ;
1718
1720
write ! ( w, "<a href=\" #{}\" class=\" anchor\" ></a>" , id) ;
1719
1721
write ! ( w, "<h3 class=\" code-header in-band\" >" ) ;
@@ -1737,11 +1739,11 @@ pub(crate) fn render_impl_summary(
1737
1739
let is_trait = i. inner_impl ( ) . trait_ . is_some ( ) ;
1738
1740
if is_trait {
1739
1741
if let Some ( portability) = portability ( & i. impl_item , Some ( parent) ) {
1740
- write ! ( w, "<div class=\" item-info\" >{}</div >" , portability) ;
1742
+ write ! ( w, "<span class=\" item-info\" >{}</span >" , portability) ;
1741
1743
}
1742
1744
}
1743
1745
1744
- w. write_str ( "</div >" ) ;
1746
+ w. write_str ( "</section >" ) ;
1745
1747
}
1746
1748
1747
1749
fn print_sidebar ( cx : & Context < ' _ > , it : & clean:: Item , buffer : & mut Buffer ) {
@@ -1802,19 +1804,9 @@ fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buffer) {
1802
1804
// to navigate the documentation (though slightly inefficiently).
1803
1805
1804
1806
if !it. is_mod ( ) {
1805
- buffer. write_str ( "<h2 class=\" location\" >In " ) ;
1806
- for ( i, name) in cx. current . iter ( ) . take ( parentlen) . enumerate ( ) {
1807
- if i > 0 {
1808
- buffer. write_str ( "::<wbr>" ) ;
1809
- }
1810
- write ! (
1811
- buffer,
1812
- "<a href=\" {}index.html\" >{}</a>" ,
1813
- & cx. root_path( ) [ ..( cx. current. len( ) - i - 1 ) * 3 ] ,
1814
- * name
1815
- ) ;
1816
- }
1817
- buffer. write_str ( "</h2>" ) ;
1807
+ let path: String = cx. current . iter ( ) . map ( |s| s. as_str ( ) ) . intersperse ( "::" ) . collect ( ) ;
1808
+
1809
+ write ! ( buffer, "<h2 class=\" location\" ><a href=\" index.html\" >In {}</a></h2>" , path) ;
1818
1810
}
1819
1811
1820
1812
// Sidebar refers to the enclosing module, not this module.
0 commit comments