@@ -955,32 +955,20 @@ fn assoc_method(
955955/// consequence of the above rules.
956956fn render_stability_since_raw_with_extra (
957957 w : & mut Buffer ,
958- ver : Option < StableSince > ,
958+ stable_version : Option < StableSince > ,
959959 const_stability : Option < ConstStability > ,
960- containing_ver : Option < StableSince > ,
961- containing_const_ver : Option < StableSince > ,
962960 extra_class : & str ,
963961) -> bool {
964- let stable_version = if ver != containing_ver
965- && let Some ( ver) = & ver
966- {
967- since_to_string ( ver)
968- } else {
969- None
970- } ;
971-
972962 let mut title = String :: new ( ) ;
973963 let mut stability = String :: new ( ) ;
974964
975- if let Some ( ver ) = stable_version {
976- stability. push_str ( ver . as_str ( ) ) ;
977- title. push_str ( & format ! ( "Stable since Rust version {ver }" ) ) ;
965+ if let Some ( version ) = stable_version. and_then ( |version| since_to_string ( & version ) ) {
966+ stability. push_str ( & version ) ;
967+ title. push_str ( & format ! ( "Stable since Rust version {version }" ) ) ;
978968 }
979969
980970 let const_title_and_stability = match const_stability {
981- Some ( ConstStability { level : StabilityLevel :: Stable { since, .. } , .. } )
982- if Some ( since) != containing_const_ver =>
983- {
971+ Some ( ConstStability { level : StabilityLevel :: Stable { since, .. } , .. } ) => {
984972 since_to_string ( & since)
985973 . map ( |since| ( format ! ( "const since {since}" ) , format ! ( "const: {since}" ) ) )
986974 }
@@ -1035,17 +1023,8 @@ fn render_stability_since_raw(
10351023 w : & mut Buffer ,
10361024 ver : Option < StableSince > ,
10371025 const_stability : Option < ConstStability > ,
1038- containing_ver : Option < StableSince > ,
1039- containing_const_ver : Option < StableSince > ,
10401026) -> bool {
1041- render_stability_since_raw_with_extra (
1042- w,
1043- ver,
1044- const_stability,
1045- containing_ver,
1046- containing_const_ver,
1047- "" ,
1048- )
1027+ render_stability_since_raw_with_extra ( w, ver, const_stability, "" )
10491028}
10501029
10511030fn render_assoc_item (
@@ -1535,7 +1514,6 @@ fn render_impl(
15351514 cx : & mut Context < ' _ > ,
15361515 item : & clean:: Item ,
15371516 parent : & clean:: Item ,
1538- containing_item : & clean:: Item ,
15391517 link : AssocItemLink < ' _ > ,
15401518 render_mode : RenderMode ,
15411519 is_default_item : bool ,
@@ -1630,7 +1608,7 @@ fn render_impl(
16301608 } )
16311609 . map ( |item| format ! ( "{}.{name}" , item. type_( ) ) ) ;
16321610 write ! ( w, "<section id=\" {id}\" class=\" {item_type}{in_trait_class}\" >" ) ;
1633- render_rightside ( w, cx, item, containing_item , render_mode) ;
1611+ render_rightside ( w, cx, item, render_mode) ;
16341612 if trait_. is_some ( ) {
16351613 // Anchors are only used on trait impls.
16361614 write ! ( w, "<a href=\" #{id}\" class=\" anchor\" >§</a>" ) ;
@@ -1652,7 +1630,7 @@ fn render_impl(
16521630 let source_id = format ! ( "{item_type}.{name}" ) ;
16531631 let id = cx. derive_id ( & source_id) ;
16541632 write ! ( w, "<section id=\" {id}\" class=\" {item_type}{in_trait_class}\" >" ) ;
1655- render_rightside ( w, cx, item, containing_item , render_mode) ;
1633+ render_rightside ( w, cx, item, render_mode) ;
16561634 if trait_. is_some ( ) {
16571635 // Anchors are only used on trait impls.
16581636 write ! ( w, "<a href=\" #{id}\" class=\" anchor\" >§</a>" ) ;
@@ -1738,7 +1716,6 @@ fn render_impl(
17381716 cx,
17391717 trait_item,
17401718 if trait_. is_some ( ) { & i. impl_item } else { parent } ,
1741- parent,
17421719 link,
17431720 render_mode,
17441721 false ,
@@ -1754,7 +1731,6 @@ fn render_impl(
17541731 t : & clean:: Trait ,
17551732 i : & clean:: Impl ,
17561733 parent : & clean:: Item ,
1757- containing_item : & clean:: Item ,
17581734 render_mode : RenderMode ,
17591735 rendering_params : ImplRenderingParameters ,
17601736 ) {
@@ -1782,7 +1758,6 @@ fn render_impl(
17821758 cx,
17831759 trait_item,
17841760 parent,
1785- containing_item,
17861761 assoc_link,
17871762 render_mode,
17881763 true ,
@@ -1805,7 +1780,6 @@ fn render_impl(
18051780 t,
18061781 i. inner_impl ( ) ,
18071782 & i. impl_item ,
1808- parent,
18091783 render_mode,
18101784 rendering_params,
18111785 ) ;
@@ -1827,7 +1801,6 @@ fn render_impl(
18271801 cx,
18281802 i,
18291803 parent,
1830- parent,
18311804 rendering_params. show_def_docs ,
18321805 use_absolute,
18331806 aliases,
@@ -1875,20 +1848,14 @@ fn render_impl(
18751848
18761849// Render the items that appear on the right side of methods, impls, and
18771850// associated types. For example "1.0.0 (const: 1.39.0) · source".
1878- fn render_rightside (
1879- w : & mut Buffer ,
1880- cx : & Context < ' _ > ,
1881- item : & clean:: Item ,
1882- containing_item : & clean:: Item ,
1883- render_mode : RenderMode ,
1884- ) {
1851+ fn render_rightside ( w : & mut Buffer , cx : & Context < ' _ > , item : & clean:: Item , render_mode : RenderMode ) {
18851852 let tcx = cx. tcx ( ) ;
18861853
18871854 // FIXME: Once https://github.com/rust-lang/rust/issues/67792 is implemented, we can remove
18881855 // this condition.
1889- let ( const_stability, const_stable_since ) = match render_mode {
1890- RenderMode :: Normal => ( item. const_stability ( tcx) , containing_item . const_stable_since ( tcx ) ) ,
1891- RenderMode :: ForDeref { .. } => ( None , None ) ,
1856+ let const_stability = match render_mode {
1857+ RenderMode :: Normal => item. const_stability ( tcx) ,
1858+ RenderMode :: ForDeref { .. } => None ,
18921859 } ;
18931860 let src_href = cx. src_href ( item) ;
18941861 let has_src_ref = src_href. is_some ( ) ;
@@ -1898,8 +1865,6 @@ fn render_rightside(
18981865 & mut rightside,
18991866 item. stable_since ( tcx) ,
19001867 const_stability,
1901- containing_item. stable_since ( tcx) ,
1902- const_stable_since,
19031868 if has_src_ref { "" } else { " rightside" } ,
19041869 ) ;
19051870 if let Some ( link) = src_href {
@@ -1921,7 +1886,6 @@ pub(crate) fn render_impl_summary(
19211886 cx : & mut Context < ' _ > ,
19221887 i : & Impl ,
19231888 parent : & clean:: Item ,
1924- containing_item : & clean:: Item ,
19251889 show_def_docs : bool ,
19261890 use_absolute : Option < bool > ,
19271891 // This argument is used to reference same type with different paths to avoid duplication
@@ -1936,7 +1900,7 @@ pub(crate) fn render_impl_summary(
19361900 format ! ( " data-aliases=\" {}\" " , aliases. join( "," ) )
19371901 } ;
19381902 write ! ( w, "<section id=\" {id}\" class=\" impl\" {aliases}>" ) ;
1939- render_rightside ( w, cx, & i. impl_item , containing_item , RenderMode :: Normal ) ;
1903+ render_rightside ( w, cx, & i. impl_item , RenderMode :: Normal ) ;
19401904 write ! (
19411905 w,
19421906 "<a href=\" #{id}\" class=\" anchor\" >§</a>\
0 commit comments