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),
}
}