We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c003c01 commit ddb31deCopy full SHA for ddb31de
src/librustdoc/clean/mod.rs
@@ -2206,10 +2206,12 @@ fn clean_maybe_renamed_item<'tcx>(
2206
};
2207
2208
let mut extra_attrs = Vec::new();
2209
- if let Some(hir::Node::Item(use_node)) =
2210
- import_id.and_then(|def_id| cx.tcx.hir().find_by_def_id(def_id))
+ if let Some(import_id) = import_id &&
+ let Some(hir::Node::Item(use_node)) = cx.tcx.hir().find_by_def_id(import_id)
2211
{
2212
- // We get all the various imports' attributes.
+ // First, we add the attributes from the current import.
2213
+ extra_attrs.extend_from_slice(inline::load_attrs(cx, import_id.to_def_id()));
2214
+ // Then we get all the various imports' attributes.
2215
get_all_import_attributes(use_node, cx.tcx, item.owner_id.def_id, &mut extra_attrs);
2216
}
2217
0 commit comments