From 98569ffe5b19e0c25fedc5caf10f47669b239d05 Mon Sep 17 00:00:00 2001 From: Jacob Pratt Date: Sun, 20 Oct 2024 03:09:33 -0400 Subject: [PATCH] Hide deprecations from docs This excludes deprecated enum variants, which must still be known for exhaustiveness checking. --- time/src/duration.rs | 1 + time/src/format_description/borrowed_format_item.rs | 13 ------------- time/src/format_description/mod.rs | 5 +++-- time/src/instant.rs | 1 + time/src/lib.rs | 5 +++-- 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/time/src/duration.rs b/time/src/duration.rs index b3d00566b..de482f61c 100644 --- a/time/src/duration.rs +++ b/time/src/duration.rs @@ -1167,6 +1167,7 @@ impl Duration { /// Runs a closure, returning the duration of time it took to run. The return value of the /// closure is provided in the second part of the tuple. + #[doc(hidden)] #[cfg(feature = "std")] #[deprecated( since = "0.3.32", diff --git a/time/src/format_description/borrowed_format_item.rs b/time/src/format_description/borrowed_format_item.rs index 4f3e6386c..2e97efd48 100644 --- a/time/src/format_description/borrowed_format_item.rs +++ b/time/src/format_description/borrowed_format_item.rs @@ -5,19 +5,6 @@ use alloc::string::String; #[cfg(feature = "alloc")] use core::fmt; -/// A complete description of how to format and parse a type. -/// -/// This alias exists for backwards-compatibility. It is recommended to use `BorrowedFormatItem` -/// for clarity, as it is more explicit that the data is borrowed rather than owned. -#[cfg(doc)] -#[deprecated( - since = "0.3.35", - note = "use `BorrowedFormatItem` instead for clarity" -)] -pub type FormatItem<'a> = BorrowedFormatItem<'a>; - -#[cfg(not(doc))] -pub use self::BorrowedFormatItem as FormatItem; use crate::error; use crate::format_description::Component; diff --git a/time/src/format_description/mod.rs b/time/src/format_description/mod.rs index 67882afe7..4bd7aa5dd 100644 --- a/time/src/format_description/mod.rs +++ b/time/src/format_description/mod.rs @@ -16,8 +16,9 @@ mod owned_format_item; mod parse; pub use borrowed_format_item::BorrowedFormatItem; -#[allow(deprecated)] -pub use borrowed_format_item::FormatItem; +#[doc(hidden)] +#[deprecated(since = "0.3.37", note = "use `BorrowedFormatItem` for clarity")] +pub use borrowed_format_item::BorrowedFormatItem as FormatItem; #[cfg(feature = "alloc")] pub use owned_format_item::OwnedFormatItem; diff --git a/time/src/instant.rs b/time/src/instant.rs index 9f71070aa..bdce82678 100644 --- a/time/src/instant.rs +++ b/time/src/instant.rs @@ -28,6 +28,7 @@ use crate::Duration; /// /// This implementation allows for operations with signed [`Duration`]s, but is otherwise identical /// to [`std::time::Instant`]. +#[doc(hidden)] #[deprecated( since = "0.3.35", note = "import `std::time::Instant` and `time::ext::InstantExt` instead" diff --git a/time/src/lib.rs b/time/src/lib.rs index 05fbdafdd..10f2e7f5b 100644 --- a/time/src/lib.rs +++ b/time/src/lib.rs @@ -41,7 +41,7 @@ //! //! - `serde` //! -//! Enables [serde](https://docs.rs/serde) support for all types except [`Instant`]. +//! Enables [serde](https://docs.rs/serde) support for all types. //! //! - `serde-human-readable` (_implicitly enables `serde`, `formatting`, and `parsing`_) //! @@ -58,7 +58,7 @@ //! //! - `quickcheck` (_implicitly enables `alloc`_) //! -//! Enables [quickcheck](https://docs.rs/quickcheck) support for all types except [`Instant`]. +//! Enables [quickcheck](https://docs.rs/quickcheck) support for all types. //! //! - `wasm-bindgen` //! @@ -118,6 +118,7 @@ pub use time_core::convert; pub use crate::date::Date; pub use crate::duration::Duration; pub use crate::error::Error; +#[doc(hidden)] #[cfg(feature = "std")] #[allow(deprecated)] pub use crate::instant::Instant;