From b351c2b41859af1881bdb29d87812dd8922d7faa Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 9 Jun 2022 18:02:46 -0700 Subject: [PATCH] Work around rustdoc showing private internals of associated const --- src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 9a439806..84af1408 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -497,6 +497,11 @@ impl Comparator { } impl Prerelease { + // Work around https://github.com/rust-lang/rust/issues/97933 + #[cfg(doc)] + pub const EMPTY: Self = ""; + + #[cfg(not(doc))] pub const EMPTY: Self = Prerelease { identifier: Identifier::empty(), }; @@ -515,6 +520,11 @@ impl Prerelease { } impl BuildMetadata { + // Work around https://github.com/rust-lang/rust/issues/97933 + #[cfg(doc)] + pub const EMPTY: Self = ""; + + #[cfg(not(doc))] pub const EMPTY: Self = BuildMetadata { identifier: Identifier::empty(), };