about summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorTor Hovland <tor.hovland@bekk.no>2021-04-14 20:49:08 +0200
committerTor Hovland <tor.hovland@bekk.no>2021-04-18 10:46:06 +0200
commitfca088ae23cd2f3ea261e1d0c04e799a2918bb6f (patch)
tree426d2e5666b5b53be372ec71bb79d34dc4b11edd /src/librustdoc/html
parent1e2ab998c378e3c9b532e811a8f93b6a65711f92 (diff)
downloadrust-fca088ae23cd2f3ea261e1d0c04e799a2918bb6f.tar.gz
rust-fca088ae23cd2f3ea261e1d0c04e799a2918bb6f.zip
Now also displays portability tags.
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/render/print_item.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index c37a21d1ade..045ff5b4b89 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -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)