about summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorbinarycat <binarycat@envs.net>2025-06-10 13:35:46 -0500
committerbinarycat <binarycat@envs.net>2025-08-08 11:40:03 -0500
commit5e8ebd5ecd8546591a6707ac9e1a3b8a64c72f76 (patch)
treeb7453c5a9df4ce7e890e4a3c5c45dbe0ea6f8dba /src/librustdoc/html/render
parent1140e90074b0cbcfdea8535e4b51877e2838227e (diff)
rustdoc: IndexItem::{stability -> is_unstable}
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/mod.rs10
-rw-r--r--src/librustdoc/html/render/search_index.rs4
2 files changed, 4 insertions, 10 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 29917bb0fca..81c05d93f82 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -50,8 +50,7 @@ use std::{fs, str};
 use askama::Template;
 use itertools::Either;
 use rustc_attr_data_structures::{
-    ConstStability, DeprecatedSince, Deprecation, RustcVersion, Stability, StabilityLevel,
-    StableSince,
+    ConstStability, DeprecatedSince, Deprecation, RustcVersion, StabilityLevel, StableSince,
 };
 use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet};
 use rustc_hir::Mutability;
@@ -141,12 +140,7 @@ pub(crate) struct IndexItem {
     pub(crate) search_type: Option<IndexItemFunctionType>,
     pub(crate) aliases: Box<[Symbol]>,
     pub(crate) deprecation: Option<Deprecation>,
-    pub(crate) stability: Option<Stability>,
-}
-impl IndexItem {
-    fn is_unstable(&self) -> bool {
-        matches!(&self.stability, Some(Stability { level: StabilityLevel::Unstable { .. }, .. }))
-    }
+    pub(crate) is_unstable: bool,
 }
 
 /// A type used for the search index.
diff --git a/src/librustdoc/html/render/search_index.rs b/src/librustdoc/html/render/search_index.rs
index 6635aa02e97..a0911bf5873 100644
--- a/src/librustdoc/html/render/search_index.rs
+++ b/src/librustdoc/html/render/search_index.rs
@@ -93,7 +93,7 @@ pub(crate) fn build_index(
                 ),
                 aliases: item.attrs.get_doc_aliases(),
                 deprecation: item.deprecation(tcx),
-                stability: item.stability(tcx),
+                is_unstable: item.stability(tcx).is_some_and(|x| x.is_unstable()),
             });
         }
     }
@@ -700,7 +700,7 @@ pub(crate) fn build_index(
                     // bitmasks always use 1-indexing for items, with 0 as the crate itself
                     deprecated.push(u32::try_from(index + 1).unwrap());
                 }
-                if item.is_unstable() {
+                if item.is_unstable {
                     unstable.push(u32::try_from(index + 1).unwrap());
                 }
             }