Now also displays portability tags.

This commit is contained in:
Tor Hovland 2021-04-14 20:49:08 +02:00
parent 1e2ab998c3
commit fca088ae23
5 changed files with 36 additions and 14 deletions

View file

@ -282,9 +282,14 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
}
clean::ImportItem(ref import) => {
let (stab, stab_tags) = if let Some(def_id) = import.source.did {
// Just need an item with the correct def_id
let import_item = clean::Item { def_id, ..myitem.clone() };
let (stab, stab_tags) = if let (Some(def_id), Some(attrs)) =
(import.source.did, import.source.attrs.clone())
{
let attrs = Box::new(attrs);
// Just need an item with the correct def_id and attrs
let import_item = clean::Item { def_id, attrs, ..myitem.clone() };
let stab = import_item.stability_class(cx.tcx());
let stab_tags = Some(extra_info_tags(&import_item, item, cx.tcx()));
(stab, stab_tags)