Skip to content

Commit

Permalink
Merge pull request #1511 from dtolnay/notdoc
Browse files Browse the repository at this point in the history
Add `cfg(not(doc))` to `doc(hidden)` functions
  • Loading branch information
dtolnay authored Sep 15, 2023
2 parents 04c9972 + 1b0d7f8 commit 858e578
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ident.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::lookahead;
pub use proc_macro2::Ident;

#[cfg(feature = "parsing")]
#[cfg(not(doc))] // Rustdoc bug: does not respect the doc(hidden)
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Ident(marker: lookahead::TokenMarker) -> Ident {
Expand Down
1 change: 1 addition & 0 deletions src/lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ impl Hash for Lifetime {
}

#[cfg(feature = "parsing")]
#[cfg(not(doc))] // Rustdoc bug: does not respect the doc(hidden)
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Lifetime(marker: lookahead::TokenMarker) -> Lifetime {
Expand Down
3 changes: 3 additions & 0 deletions src/lit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ macro_rules! lit_extra_traits {
}

#[cfg(feature = "parsing")]
#[cfg(not(doc))] // Rustdoc bug: does not respect the doc(hidden)
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn $ty(marker: lookahead::TokenMarker) -> $ty {
Expand All @@ -774,6 +775,7 @@ lit_extra_traits!(LitInt);
lit_extra_traits!(LitFloat);

#[cfg(feature = "parsing")]
#[cfg(not(doc))] // Rustdoc bug: does not respect the doc(hidden)
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn LitBool(marker: lookahead::TokenMarker) -> LitBool {
Expand All @@ -794,6 +796,7 @@ ast_enum! {
}

#[cfg(feature = "parsing")]
#[cfg(not(doc))] // Rustdoc bug: does not respect the doc(hidden)
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn Lit(marker: lookahead::TokenMarker) -> Lit {
Expand Down

0 comments on commit 858e578

Please sign in to comment.