about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-11-28 14:38:41 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2024-12-01 21:54:55 +0100
commite60a7a4c24477cfadacb21926a4020b7bbf811e4 (patch)
tree97f36f71172046e5ab06a887975d0a2141fd05cc
parent5f9e71627c860058e30c0bc1f8cd4c42de5083ce (diff)
downloadrust-e60a7a4c24477cfadacb21926a4020b7bbf811e4.tar.gz
rust-e60a7a4c24477cfadacb21926a4020b7bbf811e4.zip
Add `unreachable!` in new `FormatRenderer` methods for `JsonRenderer` implementation
-rw-r--r--src/librustdoc/json/mod.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/librustdoc/json/mod.rs b/src/librustdoc/json/mod.rs
index 9e512e87afc..dd190be892f 100644
--- a/src/librustdoc/json/mod.rs
+++ b/src/librustdoc/json/mod.rs
@@ -162,8 +162,13 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
         ))
     }
 
-    fn make_child_renderer(&mut self) -> Self::InfoType {}
-    fn set_back_info(&mut self, _info: Self::InfoType) {}
+    fn make_child_renderer(&mut self) -> Self::InfoType {
+        unreachable!("RUN_ON_MODULE = false should never call make_child_renderer")
+    }
+
+    fn set_back_info(&mut self, _info: Self::InfoType) {
+        unreachable!("RUN_ON_MODULE = false should never call set_back_info")
+    }
 
     /// Inserts an item into the index. This should be used rather than directly calling insert on
     /// the hashmap because certain items (traits and types) need to have their mappings for trait