From 1b0d7f807862cb36256848a9f55a81a9aca41976 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 15 Sep 2023 12:55:46 -0600 Subject: [PATCH] Add cfg(not(doc)) to doc(hidden) functions --- src/ident.rs | 1 + src/lifetime.rs | 1 + src/lit.rs | 3 +++ 3 files changed, 5 insertions(+) diff --git a/src/ident.rs b/src/ident.rs index 41eb72129c..4abb7dd34e 100644 --- a/src/ident.rs +++ b/src/ident.rs @@ -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 { diff --git a/src/lifetime.rs b/src/lifetime.rs index 96920ad05c..98f6fa4c50 100644 --- a/src/lifetime.rs +++ b/src/lifetime.rs @@ -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 { diff --git a/src/lit.rs b/src/lit.rs index 5f61fbfed7..5b6438eafd 100644 --- a/src/lit.rs +++ b/src/lit.rs @@ -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 { @@ -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 { @@ -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 {