about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2021-04-22 19:47:58 -0400
committerJoshua Nelson <jyn514@gmail.com>2021-04-24 11:03:02 -0400
commit03ace761fbe0735bc5b76fbe94e4ef4478cbfcde (patch)
tree6b6be401814452ac99b5ad36db5aa6f6c5ca65b8 /src
parente11a9fa52a3f372dadd6db3d3f2ed7dc2621dcc4 (diff)
downloadrust-03ace761fbe0735bc5b76fbe94e4ef4478cbfcde.tar.gz
rust-03ace761fbe0735bc5b76fbe94e4ef4478cbfcde.zip
rustdoc: Turn `JsonRenderer::mod_item_in` into `unreachable!()`
The JSON renderer no longer gets called on modules.
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/json/mod.rs17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/librustdoc/json/mod.rs b/src/librustdoc/json/mod.rs
index b048e7f919f..96ea4b6c3b8 100644
--- a/src/librustdoc/json/mod.rs
+++ b/src/librustdoc/json/mod.rs
@@ -181,21 +181,8 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
         Ok(())
     }
 
-    fn mod_item_in(&mut self, item: &clean::Item) -> Result<(), Error> {
-        use clean::types::ItemKind::*;
-        if let ModuleItem(m) = &*item.kind {
-            for item in &m.items {
-                match &*item.kind {
-                    // These don't have names so they don't get added to the output by default
-                    ImportItem(_) => self.item(item.clone()).unwrap(),
-                    ExternCrateItem { .. } => self.item(item.clone()).unwrap(),
-                    ImplItem(i) => i.items.iter().for_each(|i| self.item(i.clone()).unwrap()),
-                    _ => {}
-                }
-            }
-        }
-        self.item(item.clone()).unwrap();
-        Ok(())
+    fn mod_item_in(&mut self, _item: &clean::Item) -> Result<(), Error> {
+        unreachable!("RUN_ON_MODULE = false should never call mod_item_in")
     }
 
     fn after_krate(&mut self) -> Result<(), Error> {