未验证 提交 46c517b7 编写于 作者: Y Yuki Okushi 提交者: GitHub

Rollup merge of #84459 - jyn514:json-mod, r=aDotInTheVoid

rustdoc: Turn `JsonRenderer::mod_item_in` into `unreachable!()`

The JSON renderer no longer gets called on modules (since https://github.com/rust-lang/rust/pull/83055).

r? ``@aDotInTheVoid``
......@@ -181,21 +181,8 @@ fn item(&mut self, item: clean::Item) -> Result<(), Error> {
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> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册