@@ -996,32 +996,20 @@ fn assoc_method(
996996/// consequence of the above rules.
997997fn render_stability_since_raw_with_extra (
998998 w : & mut Buffer ,
999- ver : Option < StableSince > ,
999+ stable_version : Option < StableSince > ,
10001000 const_stability : Option < ConstStability > ,
1001- containing_ver : Option < StableSince > ,
1002- containing_const_ver : Option < StableSince > ,
10031001 extra_class : & str ,
10041002) -> bool {
1005- let stable_version = if ver != containing_ver
1006- && let Some ( ver) = & ver
1007- {
1008- since_to_string ( ver)
1009- } else {
1010- None
1011- } ;
1012-
10131003 let mut title = String :: new ( ) ;
10141004 let mut stability = String :: new ( ) ;
10151005
1016- if let Some ( ver ) = stable_version {
1017- stability. push_str ( ver . as_str ( ) ) ;
1018- title. push_str ( & format ! ( "Stable since Rust version {ver }" ) ) ;
1006+ if let Some ( version ) = stable_version. and_then ( |version| since_to_string ( & version ) ) {
1007+ stability. push_str ( & version ) ;
1008+ title. push_str ( & format ! ( "Stable since Rust version {version }" ) ) ;
10191009 }
10201010
10211011 let const_title_and_stability = match const_stability {
1022- Some ( ConstStability { level : StabilityLevel :: Stable { since, .. } , .. } )
1023- if Some ( since) != containing_const_ver =>
1024- {
1012+ Some ( ConstStability { level : StabilityLevel :: Stable { since, .. } , .. } ) => {
10251013 since_to_string ( & since)
10261014 . map ( |since| ( format ! ( "const since {since}" ) , format ! ( "const: {since}" ) ) )
10271015 }
@@ -1076,17 +1064,8 @@ fn render_stability_since_raw(
10761064 w : & mut Buffer ,
10771065 ver : Option < StableSince > ,
10781066 const_stability : Option < ConstStability > ,
1079- containing_ver : Option < StableSince > ,
1080- containing_const_ver : Option < StableSince > ,
10811067) -> bool {
1082- render_stability_since_raw_with_extra (
1083- w,
1084- ver,
1085- const_stability,
1086- containing_ver,
1087- containing_const_ver,
1088- "" ,
1089- )
1068+ render_stability_since_raw_with_extra ( w, ver, const_stability, "" )
10901069}
10911070
10921071fn render_assoc_item (
@@ -1585,7 +1564,6 @@ fn render_impl(
15851564 cx : & mut Context < ' _ > ,
15861565 item : & clean:: Item ,
15871566 parent : & clean:: Item ,
1588- containing_item : & clean:: Item ,
15891567 link : AssocItemLink < ' _ > ,
15901568 render_mode : RenderMode ,
15911569 is_default_item : bool ,
@@ -1681,7 +1659,7 @@ fn render_impl(
16811659 } )
16821660 . map ( |item| format ! ( "{}.{name}" , item. type_( ) ) ) ;
16831661 write ! ( w, "<section id=\" {id}\" class=\" {item_type}{in_trait_class}\" >" ) ;
1684- render_rightside ( w, cx, item, containing_item , render_mode) ;
1662+ render_rightside ( w, cx, item, render_mode) ;
16851663 if trait_. is_some ( ) {
16861664 // Anchors are only used on trait impls.
16871665 write ! ( w, "<a href=\" #{id}\" class=\" anchor\" >§</a>" ) ;
@@ -1703,7 +1681,7 @@ fn render_impl(
17031681 let source_id = format ! ( "{item_type}.{name}" ) ;
17041682 let id = cx. derive_id ( & source_id) ;
17051683 write ! ( w, "<section id=\" {id}\" class=\" {item_type}{in_trait_class}\" >" ) ;
1706- render_rightside ( w, cx, item, containing_item , render_mode) ;
1684+ render_rightside ( w, cx, item, render_mode) ;
17071685 if trait_. is_some ( ) {
17081686 // Anchors are only used on trait impls.
17091687 write ! ( w, "<a href=\" #{id}\" class=\" anchor\" >§</a>" ) ;
@@ -1789,7 +1767,6 @@ fn render_impl(
17891767 cx,
17901768 trait_item,
17911769 if trait_. is_some ( ) { & i. impl_item } else { parent } ,
1792- parent,
17931770 link,
17941771 render_mode,
17951772 false ,
@@ -1805,7 +1782,6 @@ fn render_impl(
18051782 t : & clean:: Trait ,
18061783 i : & clean:: Impl ,
18071784 parent : & clean:: Item ,
1808- containing_item : & clean:: Item ,
18091785 render_mode : RenderMode ,
18101786 rendering_params : ImplRenderingParameters ,
18111787 ) {
@@ -1833,7 +1809,6 @@ fn render_impl(
18331809 cx,
18341810 trait_item,
18351811 parent,
1836- containing_item,
18371812 assoc_link,
18381813 render_mode,
18391814 true ,
@@ -1856,7 +1831,6 @@ fn render_impl(
18561831 t,
18571832 i. inner_impl ( ) ,
18581833 & i. impl_item ,
1859- parent,
18601834 render_mode,
18611835 rendering_params,
18621836 ) ;
@@ -1878,7 +1852,6 @@ fn render_impl(
18781852 cx,
18791853 i,
18801854 parent,
1881- parent,
18821855 rendering_params. show_def_docs ,
18831856 use_absolute,
18841857 aliases,
@@ -1926,20 +1899,14 @@ fn render_impl(
19261899
19271900// Render the items that appear on the right side of methods, impls, and
19281901// associated types. For example "1.0.0 (const: 1.39.0) · source".
1929- fn render_rightside (
1930- w : & mut Buffer ,
1931- cx : & Context < ' _ > ,
1932- item : & clean:: Item ,
1933- containing_item : & clean:: Item ,
1934- render_mode : RenderMode ,
1935- ) {
1902+ fn render_rightside ( w : & mut Buffer , cx : & Context < ' _ > , item : & clean:: Item , render_mode : RenderMode ) {
19361903 let tcx = cx. tcx ( ) ;
19371904
19381905 // FIXME: Once https://github.com/rust-lang/rust/issues/67792 is implemented, we can remove
19391906 // this condition.
1940- let ( const_stability, const_stable_since ) = match render_mode {
1941- RenderMode :: Normal => ( item. const_stability ( tcx) , containing_item . const_stable_since ( tcx ) ) ,
1942- RenderMode :: ForDeref { .. } => ( None , None ) ,
1907+ let const_stability = match render_mode {
1908+ RenderMode :: Normal => item. const_stability ( tcx) ,
1909+ RenderMode :: ForDeref { .. } => None ,
19431910 } ;
19441911 let src_href = cx. src_href ( item) ;
19451912 let has_src_ref = src_href. is_some ( ) ;
@@ -1949,8 +1916,6 @@ fn render_rightside(
19491916 & mut rightside,
19501917 item. stable_since ( tcx) ,
19511918 const_stability,
1952- containing_item. stable_since ( tcx) ,
1953- const_stable_since,
19541919 if has_src_ref { "" } else { " rightside" } ,
19551920 ) ;
19561921 if let Some ( link) = src_href {
@@ -1972,7 +1937,6 @@ pub(crate) fn render_impl_summary(
19721937 cx : & mut Context < ' _ > ,
19731938 i : & Impl ,
19741939 parent : & clean:: Item ,
1975- containing_item : & clean:: Item ,
19761940 show_def_docs : bool ,
19771941 use_absolute : Option < bool > ,
19781942 // This argument is used to reference same type with different paths to avoid duplication
@@ -1987,7 +1951,7 @@ pub(crate) fn render_impl_summary(
19871951 format ! ( " data-aliases=\" {}\" " , aliases. join( "," ) )
19881952 } ;
19891953 write ! ( w, "<section id=\" {id}\" class=\" impl\" {aliases}>" ) ;
1990- render_rightside ( w, cx, & i. impl_item , containing_item , RenderMode :: Normal ) ;
1954+ render_rightside ( w, cx, & i. impl_item , RenderMode :: Normal ) ;
19911955 write ! (
19921956 w,
19931957 "<a href=\" #{id}\" class=\" anchor\" >§</a>\
0 commit comments