Skip to content

Commit 50b4eef

Browse files
committed
rustdoc: Fix inlining reexported custom derives
1 parent cd17b1d commit 50b4eef

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/librustdoc/clean/inline.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,23 @@ pub fn try_inline(cx: &DocContext, def: Def, name: ast::Name, visited: &mut FxHa
106106
clean::ConstantItem(build_const(cx, did))
107107
}
108108
// FIXME: proc-macros don't propagate attributes or spans across crates, so they look empty
109+
Def::Macro(did, MacroKind::Derive) |
109110
Def::Macro(did, MacroKind::Bang) => {
110111
let mac = build_macro(cx, did, name);
111-
if let clean::MacroItem(..) = mac {
112-
record_extern_fqn(cx, did, clean::TypeKind::Macro);
113-
mac
114-
} else {
115-
return None;
112+
debug!("try_inline: {:?}", mac);
113+
114+
match build_macro(cx, did, name) {
115+
clean::MacroItem(..) => {
116+
record_extern_fqn(cx, did, clean::TypeKind::Macro);
117+
mac
118+
}
119+
clean::ProcMacroItem(..) => {
120+
record_extern_fqn(cx, did, clean::TypeKind::Derive);
121+
mac
122+
}
123+
_ => {
124+
return None;
125+
}
116126
}
117127
}
118128
_ => return None,

0 commit comments

Comments
 (0)