Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: Turn JsonRenderer::mod_item_in into unreachable!() #84459

Merged
merged 1 commit into from
Apr 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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