@@ -3237,13 +3237,14 @@ fn assoc_type<W: fmt::Write>(w: &mut W, it: &clean::Item,
3237
3237
Ok ( ( ) )
3238
3238
}
3239
3239
3240
- fn render_stability_since_raw < ' a > ( w : & mut fmt:: Formatter ,
3241
- ver : Option < & ' a str > ,
3242
- containing_ver : Option < & ' a str > ) -> fmt:: Result {
3240
+ fn render_stability_since_raw < ' a , T : fmt:: Write > (
3241
+ w : & mut T ,
3242
+ ver : Option < & ' a str > ,
3243
+ containing_ver : Option < & ' a str > ,
3244
+ ) -> fmt:: Result {
3243
3245
if let Some ( v) = ver {
3244
3246
if containing_ver != ver && v. len ( ) > 0 {
3245
- write ! ( w, "<div class='since' title='Stable since Rust version {0}'>{0}</div>" ,
3246
- v) ?
3247
+ write ! ( w, "<div class='since' title='Stable since Rust version {0}'>{0}</div>" , v) ?
3247
3248
}
3248
3249
}
3249
3250
Ok ( ( ) )
@@ -4067,21 +4068,44 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
4067
4068
write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ?;
4068
4069
write ! ( w, "<span id='{}' class='invisible'><code>" , ns_id) ?;
4069
4070
assoc_type ( w, item, & Vec :: new ( ) , Some ( & tydef. type_ ) , link. anchor ( & id) ) ?;
4070
- write ! ( w, "</code></span></h4>\n " ) ?;
4071
+ write ! ( w, "</code></span></h4>" ) ?;
4071
4072
}
4072
4073
clean:: AssociatedConstItem ( ref ty, ref default) => {
4074
+ let mut version = String :: new ( ) ;
4075
+
4076
+ render_stability_since_raw ( & mut version, item. stable_since ( ) , outer_version) ?;
4077
+
4073
4078
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
4074
4079
let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
4075
4080
write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ?;
4076
- write ! ( w, "<span id='{}' class='invisible'><code>" , ns_id) ?;
4081
+ write ! ( w, "<span id='{}' class='invisible'>" , ns_id) ?;
4082
+ if !version. is_empty ( ) {
4083
+ write ! ( w, "<table class='table-display'><tbody><tr><td><code>" ) ?;
4084
+ } else {
4085
+ write ! ( w, "<code>" ) ?;
4086
+ }
4077
4087
assoc_const ( w, item, ty, default. as_ref ( ) , link. anchor ( & id) ) ?;
4088
+ if !version. is_empty ( ) {
4089
+ write ! ( w, "</code>" ) ?;
4090
+ }
4078
4091
let src = if let Some ( l) = ( Item { cx, item } ) . src_href ( ) {
4092
+ if !version. is_empty ( ) {
4093
+ write ! ( w, "</span></td><td><span class='out-of-band'>" ) ?;
4094
+ write ! ( w, "<div class='ghost'></div>{}" , version) ?;
4095
+ }
4079
4096
format ! ( "<a class='srclink' href='{}' title='{}'>[src]</a>" ,
4080
4097
l, "goto source code" )
4081
4098
} else {
4099
+ if !version. is_empty ( ) {
4100
+ write ! ( w, "</td><td>{}" , version) ?;
4101
+ }
4082
4102
String :: new ( )
4083
4103
} ;
4084
- write ! ( w, "</code>{}</span></h4>\n " , src) ?;
4104
+ if version. is_empty ( ) {
4105
+ write ! ( w, "</code>{}</span></h4>" , src) ?;
4106
+ } else {
4107
+ write ! ( w, "{}</td></tr></tbody></table></span></h4>" , src) ?;
4108
+ }
4085
4109
}
4086
4110
clean:: AssociatedTypeItem ( ref bounds, ref default) => {
4087
4111
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
0 commit comments