about summary refs log tree commit diff
path: root/src/librustdoc/formats
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-09-02 11:57:33 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-09-02 11:57:33 +0200
commit7b35d8e1ab2d913f4b15d0ee21d5bd8d50798e9c (patch)
tree42f349b12245a2bdbc72bdbd276527b52fbc87d4 /src/librustdoc/formats
parentc0bb3b98bb7aac24a37635e5d36d961e0b14f435 (diff)
downloadrust-7b35d8e1ab2d913f4b15d0ee21d5bd8d50798e9c.tar.gz
rust-7b35d8e1ab2d913f4b15d0ee21d5bd8d50798e9c.zip
Fix `unknown number` error when generating search index
Diffstat (limited to 'src/librustdoc/formats')
-rw-r--r--src/librustdoc/formats/item_type.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustdoc/formats/item_type.rs b/src/librustdoc/formats/item_type.rs
index e94ef517309..b8b00ab582c 100644
--- a/src/librustdoc/formats/item_type.rs
+++ b/src/librustdoc/formats/item_type.rs
@@ -78,7 +78,7 @@ impl<'de> Deserialize<'de> for ItemType {
         impl<'de> de::Visitor<'de> for ItemTypeVisitor {
             type Value = ItemType;
             fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-                write!(formatter, "an integer between 0 and 25")
+                write!(formatter, "an integer between 0 and 27")
             }
             fn visit_u64<E: de::Error>(self, v: u64) -> Result<ItemType, E> {
                 Ok(match v {
@@ -107,7 +107,8 @@ impl<'de> Deserialize<'de> for ItemType {
                     23 => ItemType::ProcAttribute,
                     24 => ItemType::ProcDerive,
                     25 => ItemType::TraitAlias,
-                    _ => return Err(E::missing_field("unknown number")),
+                    27 => ItemType::Attribute,
+                    _ => return Err(E::missing_field("unknown number for `ItemType` enum")),
                 })
             }
         }