about summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2023-09-29 12:52:30 -0700
committerMichael Howell <michael@notriddle.com>2023-12-26 12:54:17 -0700
commitf6a045cc6b24dd033c207dd63d8adccdedf672d2 (patch)
tree7ccbf87bff8e0dc808f45d9d9393cbab4a093be3 /src/librustdoc/html/render
parenta75fed74b62f95d1659ff70bea7895ed5c85bdba (diff)
downloadrust-f6a045cc6b24dd033c207dd63d8adccdedf672d2.tar.gz
rust-f6a045cc6b24dd033c207dd63d8adccdedf672d2.zip
rustdoc: search for tuples and unit by type with `()`
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/search_index.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustdoc/html/render/search_index.rs b/src/librustdoc/html/render/search_index.rs
index a1029320d2d..6c6a31bbb11 100644
--- a/src/librustdoc/html/render/search_index.rs
+++ b/src/librustdoc/html/render/search_index.rs
@@ -581,6 +581,9 @@ fn get_index_type_id(
         // The type parameters are converted to generics in `simplify_fn_type`
         clean::Slice(_) => Some(RenderTypeId::Primitive(clean::PrimitiveType::Slice)),
         clean::Array(_, _) => Some(RenderTypeId::Primitive(clean::PrimitiveType::Array)),
+        clean::Tuple(ref n) if n.is_empty() => {
+            Some(RenderTypeId::Primitive(clean::PrimitiveType::Unit))
+        }
         clean::Tuple(_) => Some(RenderTypeId::Primitive(clean::PrimitiveType::Tuple)),
         clean::QPath(ref data) => {
             if data.self_type.is_self_type()