@@ -282,11 +282,29 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
282
282
}
283
283
284
284
clean:: ImportItem ( ref import) => {
285
+ let ( stab, stab_tags) = if let Some ( def_id) = import. source . did {
286
+ // Just need an item with the correct def_id
287
+ let import_item = clean:: Item { def_id, ..myitem. clone ( ) } ;
288
+ let stab = import_item. stability_class ( cx. tcx ( ) ) ;
289
+ let stab_tags = Some ( extra_info_tags ( & import_item, item, cx. tcx ( ) ) ) ;
290
+ ( stab, stab_tags)
291
+ } else {
292
+ ( None , None )
293
+ } ;
294
+
295
+ let add = if stab. is_some ( ) { " " } else { "" } ;
296
+
285
297
write ! (
286
298
w,
287
- "<tr><td><code>{}{}</code></td></tr>" ,
288
- myitem. visibility. print_with_space( myitem. def_id, cx) ,
289
- import. print( cx) ,
299
+ "<tr class=\" {stab}{add}module-item\" >\
300
+ <td><code>{vis}{imp}</code></td>\
301
+ <td class=\" docblock-short\" >{stab_tags}</td>\
302
+ </tr>",
303
+ stab = stab. unwrap_or_default( ) ,
304
+ add = add,
305
+ vis = myitem. visibility. print_with_space( myitem. def_id, cx) ,
306
+ imp = import. print( cx) ,
307
+ stab_tags = stab_tags. unwrap_or_default( ) ,
290
308
) ;
291
309
}
292
310
@@ -320,7 +338,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
320
338
docs = MarkdownSummaryLine ( & doc_value, & myitem. links( cx) ) . into_string( ) ,
321
339
class = myitem. type_( ) ,
322
340
add = add,
323
- stab = stab. unwrap_or_else ( String :: new ) ,
341
+ stab = stab. unwrap_or_default ( ) ,
324
342
unsafety_flag = unsafety_flag,
325
343
href = item_path( myitem. type_( ) , & myitem. name. unwrap( ) . as_str( ) ) ,
326
344
title = [ full_path( cx, myitem) , myitem. type_( ) . to_string( ) ]
0 commit comments