Skip to content

Commit

Permalink
Rollup merge of rust-lang#84459 - jyn514:json-mod, r=aDotInTheVoid
Browse files Browse the repository at this point in the history
rustdoc: Turn `JsonRenderer::mod_item_in` into `unreachable!()`

The JSON renderer no longer gets called on modules (since rust-lang#83055).

r? ``@aDotInTheVoid``
  • Loading branch information
JohnTitor committed Apr 24, 2021
2 parents 277b88b + 03ace76 commit 46c517b
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/librustdoc/json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit 46c517b

Please sign in to comment.