Skip to content

Commit 64aaf96

Browse files
chore: Index constants too
1 parent c92f3ee commit 64aaf96

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • rustdoc/rustdoc_processor/src/indexing

rustdoc/rustdoc_processor/src/indexing/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,10 @@ pub(crate) fn index_local_types<'a, V: IndexingVisitor>(
329329
| ItemEnum::Struct(_)
330330
| ItemEnum::TypeAlias(_)
331331
| ItemEnum::Static(_)
332-
| ItemEnum::Union(_) => {
332+
| ItemEnum::Union(_)
333+
| ItemEnum::Constant { .. } => {
333334
let name = current_item.name.as_deref().expect(
334-
"All 'struct', 'function', 'enum', 'type_alias', 'primitive', 'trait', 'static' and 'union' items have a 'name' property",
335+
"All 'struct', 'function', 'enum', 'type_alias', 'primitive', 'trait', 'static', 'union' and 'constant' items have a 'name' property",
335336
);
336337
if matches!(current_item.inner, ItemEnum::Primitive(_)) {
337338
// E.g. `std::bool` won't work, `std::primitive::bool` does work but the `primitive` module

0 commit comments

Comments
 (0)