From 3431c5ce14fc9b426e5b778feca8df7e67b9a068 Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Sat, 3 Jan 2026 15:56:07 +0000 Subject: [PATCH] fix confusing target doc cfg --- rustls-platform-verifier/src/verification/android.rs | 2 ++ rustls-platform-verifier/src/verification/apple.rs | 3 +++ rustls-platform-verifier/src/verification/others.rs | 3 +++ rustls-platform-verifier/src/verification/windows.rs | 3 +++ 4 files changed, 11 insertions(+) diff --git a/rustls-platform-verifier/src/verification/android.rs b/rustls-platform-verifier/src/verification/android.rs index 7f602e8..8037548 100644 --- a/rustls-platform-verifier/src/verification/android.rs +++ b/rustls-platform-verifier/src/verification/android.rs @@ -64,6 +64,7 @@ impl Drop for Verifier { impl Verifier { /// Creates a new instance of a TLS certificate verifier that utilizes the /// Android certificate facilities. + #[cfg_attr(docsrs, doc(cfg(all())))] pub fn new(crypto_provider: Arc) -> Result { Ok(Self { #[cfg(any(test, feature = "ffi-testing"))] @@ -268,6 +269,7 @@ fn extract_result_info( (status, msg) } +#[cfg_attr(docsrs, doc(cfg(all())))] impl ServerCertVerifier for Verifier { fn verify_server_cert( &self, diff --git a/rustls-platform-verifier/src/verification/apple.rs b/rustls-platform-verifier/src/verification/apple.rs index 34c9450..8cf0eef 100644 --- a/rustls-platform-verifier/src/verification/apple.rs +++ b/rustls-platform-verifier/src/verification/apple.rs @@ -55,6 +55,7 @@ pub struct Verifier { impl Verifier { /// Creates a new instance of a TLS certificate verifier that utilizes the Apple certificate /// facilities. + #[cfg_attr(docsrs, doc(cfg(all())))] pub fn new(crypto_provider: Arc) -> Result { Ok(Self { extra_roots: Vec::new(), @@ -68,6 +69,7 @@ impl Verifier { /// facilities with the addition of extra root certificates to trust. /// /// See [Verifier::new] for the external requirements the verifier needs. + #[cfg_attr(docsrs, doc(cfg(not(target_os = "android"))))] pub fn new_with_extra_roots( roots: impl IntoIterator>, crypto_provider: Arc, @@ -240,6 +242,7 @@ impl Verifier { } } +#[cfg_attr(docsrs, doc(cfg(all())))] impl ServerCertVerifier for Verifier { fn verify_server_cert( &self, diff --git a/rustls-platform-verifier/src/verification/others.rs b/rustls-platform-verifier/src/verification/others.rs index 63cb3b8..0f500e0 100644 --- a/rustls-platform-verifier/src/verification/others.rs +++ b/rustls-platform-verifier/src/verification/others.rs @@ -27,6 +27,7 @@ pub struct Verifier { impl Verifier { /// Creates a new verifier whose certificate validation is provided by /// WebPKI, using root certificates provided by the platform. + #[cfg_attr(docsrs, doc(cfg(all())))] pub fn new(crypto_provider: Arc) -> Result { Self::new_inner([], None, crypto_provider) } @@ -34,6 +35,7 @@ impl Verifier { /// Creates a new verifier whose certificate validation is provided by /// WebPKI, using root certificates provided by the platform and augmented by /// the provided extra root certificates. + #[cfg_attr(docsrs, doc(cfg(not(target_os = "android"))))] pub fn new_with_extra_roots( extra_roots: impl IntoIterator>, crypto_provider: Arc, @@ -130,6 +132,7 @@ impl Verifier { } } +#[cfg_attr(docsrs, doc(cfg(all())))] impl ServerCertVerifier for Verifier { fn verify_server_cert( &self, diff --git a/rustls-platform-verifier/src/verification/windows.rs b/rustls-platform-verifier/src/verification/windows.rs index afd7e6b..548854b 100644 --- a/rustls-platform-verifier/src/verification/windows.rs +++ b/rustls-platform-verifier/src/verification/windows.rs @@ -522,6 +522,7 @@ pub struct Verifier { impl Verifier { /// Creates a new instance of a TLS certificate verifier that utilizes the /// Windows certificate facilities. + #[cfg_attr(docsrs, doc(cfg(all())))] pub fn new(crypto_provider: Arc) -> Result { Ok(Self { #[cfg(any(test, feature = "ffi-testing", feature = "dbg"))] @@ -533,6 +534,7 @@ impl Verifier { /// Creates a new instance of a TLS certificate verifier that utilizes the /// Windows certificate facilities and augmented by the provided extra root certificates. + #[cfg_attr(docsrs, doc(cfg(not(target_os = "android"))))] pub fn new_with_extra_roots( roots: impl IntoIterator>, crypto_provider: Arc, @@ -660,6 +662,7 @@ impl Verifier { } } +#[cfg_attr(docsrs, doc(cfg(all())))] impl ServerCertVerifier for Verifier { fn verify_server_cert( &self,