diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index 39e2a902226..5ad24bf2681 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -1655,10 +1655,10 @@ impl clean::types::Term {
&'a self,
cx: &'a Context<'tcx>,
) -> impl fmt::Display + 'a + Captures<'tcx> {
- match self {
- clean::types::Term::Type(ty) => ty.print(cx),
- _ => todo!(),
- }
+ display_fn(move |f| match self {
+ clean::types::Term::Type(ty) => fmt::Display::fmt(&ty.print(cx), f),
+ clean::types::Term::Constant(ct) => fmt::Display::fmt(&ct.print(cx.tcx()), f),
+ })
}
}
diff --git a/src/test/rustdoc/issue-105952.rs b/src/test/rustdoc/issue-105952.rs
new file mode 100644
index 00000000000..e3f1df0063d
--- /dev/null
+++ b/src/test/rustdoc/issue-105952.rs
@@ -0,0 +1,14 @@
+#![crate_name = "foo"]
+
+#![feature(associated_const_equality)]
+pub enum ParseMode {
+ Raw,
+}
+pub trait Parse {
+ const PARSE_MODE: ParseMode;
+}
+pub trait RenderRaw {}
+
+// @hasraw foo/trait.RenderRaw.html 'impl'
+// @hasraw foo/trait.RenderRaw.html 'ParseMode::Raw'
+impl> RenderRaw for T {}