Skip to content

Commit b351c2b

Browse files
committed
Work around rustdoc showing private internals of associated const
1 parent 7a3e8f7 commit b351c2b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,11 @@ impl Comparator {
497497
}
498498

499499
impl Prerelease {
500+
// Work around https://github.com/rust-lang/rust/issues/97933
501+
#[cfg(doc)]
502+
pub const EMPTY: Self = "";
503+
504+
#[cfg(not(doc))]
500505
pub const EMPTY: Self = Prerelease {
501506
identifier: Identifier::empty(),
502507
};
@@ -515,6 +520,11 @@ impl Prerelease {
515520
}
516521

517522
impl BuildMetadata {
523+
// Work around https://github.com/rust-lang/rust/issues/97933
524+
#[cfg(doc)]
525+
pub const EMPTY: Self = "";
526+
527+
#[cfg(not(doc))]
518528
pub const EMPTY: Self = BuildMetadata {
519529
identifier: Identifier::empty(),
520530
};

0 commit comments

Comments
 (0)