From ea9432ef00ab306cdadc81fdd523b111cdae0d92 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Fri, 1 Nov 2013 23:32:58 -0700 Subject: [PATCH] Rustdoc: Properly strip private modules A private module will survive the strip-private pass if it contains trait implementations, which aren't stripped until a separate pass in render. --- src/librustdoc/html/render.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index e92d159b5a1..7bfe0910252 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -622,6 +622,11 @@ impl DocFolder for Cache { } None } + // Private modules may survive the strip-private pass if + // they contain impls for public types, but those will get + // stripped here + clean::Item { inner: clean::ModuleItem(ref m), _ } + if m.items.len() == 0 => None, i => Some(i), } }