1
Fork 0

rustdoc: Fix inlining reexported custom derives

This commit is contained in:
Georg Semmler 2018-11-28 17:10:21 +01:00
parent cd17b1d4b6
commit 50b4eefcf5
No known key found for this signature in database
GPG key ID: A87BCEE5205CE489

View file

@ -106,13 +106,23 @@ pub fn try_inline(cx: &DocContext, def: Def, name: ast::Name, visited: &mut FxHa
clean::ConstantItem(build_const(cx, did))
}
// FIXME: proc-macros don't propagate attributes or spans across crates, so they look empty
Def::Macro(did, MacroKind::Derive) |
Def::Macro(did, MacroKind::Bang) => {
let mac = build_macro(cx, did, name);
if let clean::MacroItem(..) = mac {
record_extern_fqn(cx, did, clean::TypeKind::Macro);
mac
} else {
return None;
debug!("try_inline: {:?}", mac);
match build_macro(cx, did, name) {
clean::MacroItem(..) => {
record_extern_fqn(cx, did, clean::TypeKind::Macro);
mac
}
clean::ProcMacroItem(..) => {
record_extern_fqn(cx, did, clean::TypeKind::Derive);
mac
}
_ => {
return None;
}
}
}
_ => return None,