From 50b4eefcf5ce5e0a7808c6fc3f7effcea2e628c3 Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Wed, 28 Nov 2018 17:10:21 +0100 Subject: [PATCH 01/28] rustdoc: Fix inlining reexported custom derives --- src/librustdoc/clean/inline.rs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 49cecd5b04bbc..464b6ea4fbe41 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, From 230f5d5676ffad99e64f73128dc27f629aa8e921 Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Wed, 28 Nov 2018 17:11:06 +0100 Subject: [PATCH 02/28] rustdoc: Fix inlining reexporting bang-macros --- src/librustdoc/visit_ast.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 5d221d3006f3e..b44b1d9e0ba19 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -376,6 +376,10 @@ impl<'a, 'tcx, 'rcx, 'cstore> RustdocVisitor<'a, 'tcx, 'rcx, 'cstore> { }); true } + Node::MacroDef(def) if !glob => { + om.macros.push(self.visit_local_macro(def)); + true + } _ => false, }; self.view_item_stack.remove(&def_node_id); From dd717deccb3a4698beac8edb0a75e2efb6f08ebb Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 1 Oct 2018 00:47:54 +0200 Subject: [PATCH 03/28] Add crate filtering --- src/librustdoc/html/layout.rs | 15 ++-- src/librustdoc/html/render.rs | 2 +- src/librustdoc/html/static/main.js | 99 +++++++++++++++++---- src/librustdoc/html/static/rustdoc.css | 24 ++++- src/librustdoc/html/static/themes/dark.css | 8 +- src/librustdoc/html/static/themes/light.css | 9 +- 6 files changed, 131 insertions(+), 26 deletions(-) diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index 6868c7707adc8..d585b737517b3 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -81,11 +81,16 @@ pub fn render(