From 581b63da7ecb5450d03f923b23a49493adf75ed9 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Mon, 5 Jul 2021 14:02:16 -0700 Subject: [PATCH] Restore 'doc(cfg)' labels for config items. --- core/lib/src/config/mod.rs | 7 ++----- core/lib/src/config/secret_key.rs | 1 + core/lib/src/config/shutdown.rs | 1 + core/lib/src/config/tls.rs | 2 ++ 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/lib/src/config/mod.rs b/core/lib/src/config/mod.rs index 8eb8a1bb..4ae360b9 100644 --- a/core/lib/src/config/mod.rs +++ b/core/lib/src/config/mod.rs @@ -121,23 +121,20 @@ mod tls; #[cfg(feature = "secrets")] mod secret_key; -#[doc(hidden)] pub use config::pretty_print_error; - +#[doc(hidden)] +pub use config::pretty_print_error; pub use config::Config; pub use crate::log::LogLevel; pub use shutdown::Shutdown; pub use ident::Ident; #[cfg(feature = "tls")] -#[cfg_attr(nightly, doc(cfg(feature = "tls")))] pub use tls::{TlsConfig, CipherSuite}; #[cfg(feature = "secrets")] -#[cfg_attr(nightly, doc(cfg(feature = "secrets")))] pub use secret_key::SecretKey; #[cfg(unix)] -#[cfg_attr(nightly, doc(cfg(unix)))] pub use shutdown::Sig; #[cfg(test)] diff --git a/core/lib/src/config/secret_key.rs b/core/lib/src/config/secret_key.rs index 34497ed0..c4e70214 100644 --- a/core/lib/src/config/secret_key.rs +++ b/core/lib/src/config/secret_key.rs @@ -69,6 +69,7 @@ enum Kind { /// [private cookies]: https://rocket.rs/v0.5-rc/guide/requests/#private-cookies /// [configuration guide]: https://rocket.rs/v0.5-rc/guide/configuration/#secret-key #[derive(Clone)] +#[cfg_attr(nightly, doc(cfg(feature = "secrets")))] pub struct SecretKey { pub(crate) key: Key, provided: bool, diff --git a/core/lib/src/config/shutdown.rs b/core/lib/src/config/shutdown.rs index e451eaf7..17ec6af2 100644 --- a/core/lib/src/config/shutdown.rs +++ b/core/lib/src/config/shutdown.rs @@ -18,6 +18,7 @@ use serde::{Deserialize, Serialize}; /// [`Sig::Chld`], and so on. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] +#[cfg_attr(nightly, doc(cfg(unix)))] pub enum Sig { /// The `SIGALRM` Unix signal. Alrm, diff --git a/core/lib/src/config/tls.rs b/core/lib/src/config/tls.rs index 7807244c..41554802 100644 --- a/core/lib/src/config/tls.rs +++ b/core/lib/src/config/tls.rs @@ -57,6 +57,7 @@ use indexmap::IndexSet; /// assert!(tls_config.prefer_server_cipher_order()); /// ``` #[derive(PartialEq, Debug, Clone, Deserialize, Serialize)] +#[cfg_attr(nightly, doc(cfg(feature = "tls")))] #[serde(deny_unknown_fields)] pub struct TlsConfig { /// Path or raw bytes for the DER-encoded X.509 TLS certificate chain. @@ -75,6 +76,7 @@ pub struct TlsConfig { /// A supported TLS cipher suite. #[allow(non_camel_case_types)] #[derive(PartialEq, Eq, Debug, Copy, Clone, Hash, Deserialize, Serialize)] +#[cfg_attr(nightly, doc(cfg(feature = "tls")))] #[non_exhaustive] pub enum CipherSuite { /// The TLS 1.3 `TLS_CHACHA20_POLY1305_SHA256` cipher suite.