Skip to content

Commit

Permalink
Merge pull request #281 from dtolnay/empty
Browse files Browse the repository at this point in the history
Work around rustdoc showing private internals of associated const
  • Loading branch information
dtolnay committed Jun 10, 2022
2 parents 7a3e8f7 + b351c2b commit 532f425
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib.rs
Expand Up @@ -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(),
};
Expand All @@ -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(),
};
Expand Down

0 comments on commit 532f425

Please sign in to comment.