diff options
| author | Georg Semmler <georg_semmler_05@web.de> | 2018-11-28 17:10:21 +0100 |
|---|---|---|
| committer | Georg Semmler <georg_semmler_05@web.de> | 2018-11-28 17:10:21 +0100 |
| commit | 50b4eefcf5ce5e0a7808c6fc3f7effcea2e628c3 (patch) | |
| tree | 29f2f8f4ddf0862812a22a905aa91d1e22d7c353 /src | |
| parent | cd17b1d4b684df5fb04d0ee08342446463d20b18 (diff) | |
| download | rust-50b4eefcf5ce5e0a7808c6fc3f7effcea2e628c3.tar.gz rust-50b4eefcf5ce5e0a7808c6fc3f7effcea2e628c3.zip | |
rustdoc: Fix inlining reexported custom derives
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/inline.rs | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 49cecd5b04b..464b6ea4fbe 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -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, |
