summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustdoc/html/render')
-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)