Skip to content

Commit 44382c3

Browse files
committed
Remove use of doc_cfg feature
`doc_auto_cfg` is smart enough to correctly tag all cases now
1 parent 64c84b0 commit 44382c3

12 files changed

+1
-41
lines changed

src/error/format.rs

-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use crate::error;
88
/// An error occurred when formatting.
99
#[non_exhaustive]
1010
#[allow(missing_copy_implementations)]
11-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "formatting")))]
1211
#[derive(Debug)]
1312
pub enum Format {
1413
/// The type being formatted does not contain sufficient information to format a component.
@@ -65,14 +64,12 @@ impl std::error::Error for Format {
6564
}
6665
}
6766

68-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "formatting")))]
6967
impl From<Format> for crate::Error {
7068
fn from(original: Format) -> Self {
7169
Self::Format(original)
7270
}
7371
}
7472

75-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "formatting")))]
7673
impl TryFrom<crate::Error> for Format {
7774
type Error = error::DifferentVariant;
7875

src/error/indeterminate_offset.rs

-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use core::fmt;
55
use crate::error;
66

77
/// The system's UTC offset could not be determined at the given datetime.
8-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "local-offset")))]
98
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
109
pub struct IndeterminateOffset;
1110

@@ -18,14 +17,12 @@ impl fmt::Display for IndeterminateOffset {
1817
#[cfg(feature = "std")]
1918
impl std::error::Error for IndeterminateOffset {}
2019

21-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "local-offset")))]
2220
impl From<IndeterminateOffset> for crate::Error {
2321
fn from(err: IndeterminateOffset) -> Self {
2422
Self::IndeterminateOffset(err)
2523
}
2624
}
2725

28-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "std")))]
2926
impl TryFrom<crate::Error> for IndeterminateOffset {
3027
type Error = error::DifferentVariant;
3128

src/error/invalid_format_description.rs

-12
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ use core::fmt;
66
use crate::error;
77

88
/// The format description provided was not valid.
9-
#[cfg_attr(
10-
__time_03_docs,
11-
doc(cfg(all(any(feature = "formatting", feature = "parsing"), feature = "alloc")))
12-
)]
139
#[non_exhaustive]
1410
#[derive(Debug, Clone, PartialEq, Eq)]
1511
pub enum InvalidFormatDescription {
@@ -43,20 +39,12 @@ pub enum InvalidFormatDescription {
4339
},
4440
}
4541

46-
#[cfg_attr(
47-
__time_03_docs,
48-
doc(cfg(all(any(feature = "formatting", feature = "parsing"), feature = "alloc")))
49-
)]
5042
impl From<InvalidFormatDescription> for crate::Error {
5143
fn from(original: InvalidFormatDescription) -> Self {
5244
Self::InvalidFormatDescription(original)
5345
}
5446
}
5547

56-
#[cfg_attr(
57-
__time_03_docs,
58-
doc(cfg(all(any(feature = "formatting", feature = "parsing"), feature = "alloc")))
59-
)]
6048
impl TryFrom<crate::Error> for InvalidFormatDescription {
6149
type Error = error::DifferentVariant;
6250

src/error/parse.rs

-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use core::fmt;
55
use crate::error::{self, ParseFromDescription, TryFromParsed};
66

77
/// An error that occurred at some stage of parsing.
8-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "parsing")))]
98
#[allow(variant_size_differences)]
109
#[non_exhaustive]
1110
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -40,14 +39,12 @@ impl std::error::Error for Parse {
4039
}
4140
}
4241

43-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "parsing")))]
4442
impl From<TryFromParsed> for Parse {
4543
fn from(err: TryFromParsed) -> Self {
4644
Self::TryFromParsed(err)
4745
}
4846
}
4947

50-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "parsing")))]
5148
impl TryFrom<Parse> for TryFromParsed {
5249
type Error = error::DifferentVariant;
5350

@@ -59,14 +56,12 @@ impl TryFrom<Parse> for TryFromParsed {
5956
}
6057
}
6158

62-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "parsing")))]
6359
impl From<ParseFromDescription> for Parse {
6460
fn from(err: ParseFromDescription) -> Self {
6561
Self::ParseFromDescription(err)
6662
}
6763
}
6864

69-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "parsing")))]
7065
impl TryFrom<Parse> for ParseFromDescription {
7166
type Error = error::DifferentVariant;
7267

@@ -78,7 +73,6 @@ impl TryFrom<Parse> for ParseFromDescription {
7873
}
7974
}
8075

81-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "parsing")))]
8276
impl From<Parse> for crate::Error {
8377
fn from(err: Parse) -> Self {
8478
match err {
@@ -89,7 +83,6 @@ impl From<Parse> for crate::Error {
8983
}
9084
}
9185

92-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "parsing")))]
9386
impl TryFrom<crate::Error> for Parse {
9487
type Error = error::DifferentVariant;
9588

src/error/parse_from_description.rs

-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use core::fmt;
55
use crate::error;
66

77
/// An error that occurred while parsing the input into a [`Parsed`](crate::parsing::Parsed) struct.
8-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "parsing")))]
98
#[non_exhaustive]
109
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
1110
pub enum ParseFromDescription {
@@ -30,14 +29,12 @@ impl fmt::Display for ParseFromDescription {
3029
#[cfg(feature = "std")]
3130
impl std::error::Error for ParseFromDescription {}
3231

33-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "parsing")))]
3432
impl From<ParseFromDescription> for crate::Error {
3533
fn from(original: ParseFromDescription) -> Self {
3634
Self::ParseFromDescription(original)
3735
}
3836
}
3937

40-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "parsing")))]
4138
impl TryFrom<crate::Error> for ParseFromDescription {
4239
type Error = error::DifferentVariant;
4340

src/error/try_from_parsed.rs

-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::error;
66

77
/// An error that occurred when converting a [`Parsed`](crate::parsing::Parsed) to another type.
88
#[non_exhaustive]
9-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "parsing")))]
109
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
1110
pub enum TryFromParsed {
1211
/// The [`Parsed`](crate::parsing::Parsed) did not include enough information to construct the
@@ -54,14 +53,12 @@ impl std::error::Error for TryFromParsed {
5453
}
5554
}
5655

57-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "parsing")))]
5856
impl From<TryFromParsed> for crate::Error {
5957
fn from(original: TryFromParsed) -> Self {
6058
Self::TryFromParsed(original)
6159
}
6260
}
6361

64-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "parsing")))]
6562
impl TryFrom<crate::Error> for TryFromParsed {
6663
type Error = error::DifferentVariant;
6764

src/format_description/parse.rs

-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ fn parse_item<'a>(
8080
///
8181
/// The syntax for the format description can be found in [the
8282
/// book](https://time-rs.github.io/book/api/format-description.html).
83-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "alloc")))]
8483
pub fn parse(s: &str) -> Result<Vec<FormatItem<'_>>, InvalidFormatDescription> {
8584
let mut compound = Vec::new();
8685
let mut loc = 0;

src/formatting/formattable.rs

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ mod sealed {
2727
use super::*;
2828

2929
/// Format the item using a format description, the intended output, and the various components.
30-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "formatting")))]
3130
pub trait Sealed {
3231
/// Format the item into the provided output, returning the number of bytes written.
3332
fn format_into(

src/instant.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use crate::Duration;
2525
///
2626
/// This implementation allows for operations with signed [`Duration`]s, but is otherwise identical
2727
/// to [`std::time::Instant`].
28-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "std")))]
2928
#[repr(transparent)]
3029
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
3130
pub struct Instant(pub StdInstant);

src/lib.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
//! requires the local offset will return the `Err` variant when otherwise unsound.
8282
8383
#![doc(html_playground_url = "https://play.rust-lang.org")]
84-
#![cfg_attr(__time_03_docs, feature(doc_cfg, doc_auto_cfg, doc_notable_trait))]
84+
#![cfg_attr(__time_03_docs, feature(doc_auto_cfg, doc_notable_trait))]
8585
#![cfg_attr(
8686
__time_03_docs,
8787
deny(rustdoc::broken_intra_doc_links, rustdoc::private_intra_doc_links)
@@ -315,13 +315,10 @@ mod offset_date_time;
315315
pub mod parsing;
316316
mod primitive_date_time;
317317
#[cfg(feature = "quickcheck")]
318-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "quickcheck")))]
319318
mod quickcheck;
320319
#[cfg(feature = "rand")]
321-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "rand")))]
322320
mod rand;
323321
#[cfg(feature = "serde")]
324-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "serde")))]
325322
#[allow(missing_copy_implementations, missing_debug_implementations)]
326323
pub mod serde;
327324
mod sys;

src/offset_date_time.rs

-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ impl OffsetDateTime {
5555
/// assert_eq!(OffsetDateTime::now_utc().offset(), offset!(UTC));
5656
/// ```
5757
#[cfg(feature = "std")]
58-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "std")))]
5958
pub fn now_utc() -> Self {
6059
#[cfg(all(
6160
target_arch = "wasm32",
@@ -84,7 +83,6 @@ impl OffsetDateTime {
8483
/// # }
8584
/// ```
8685
#[cfg(feature = "local-offset")]
87-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "local-offset")))]
8886
pub fn now_local() -> Result<Self, error::IndeterminateOffset> {
8987
let t = Self::now_utc();
9088
Ok(t.to_offset(UtcOffset::local_offset_at(t)?))

src/parsing/parsable.rs

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ mod sealed {
2727
use super::*;
2828

2929
/// Parse the item using a format description and an input.
30-
#[cfg_attr(__time_03_docs, doc(cfg(feature = "parsing")))]
3130
pub trait Sealed {
3231
/// Parse the item into the provided [`Parsed`] struct.
3332
///

0 commit comments

Comments
 (0)