diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f42db10..39822ed 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -142,7 +142,7 @@ jobs: - name: cargo doc (rustls; all features) run: cargo doc --locked --all-features --no-deps --document-private-items env: - RUSTDOCFLAGS: -Dwarnings + RUSTDOCFLAGS: -Dwarnings --cfg=rustls_native_certs_docsrs format: name: Format diff --git a/Cargo.toml b/Cargo.toml index 16cbeb9..a51a270 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,3 +32,9 @@ openssl-probe = "0.2" [target.'cfg(target_os = "macos")'.dependencies] security-framework = "3" + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = [ 'cfg(rustls_native_certs_docsrs)' ] } + +[package.metadata.docs.rs] +rustdoc-args = ["--cfg", "rustls_native_certs_docsrs"] diff --git a/src/lib.rs b/src/lib.rs index 44631f1..1b0d20d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,7 +19,7 @@ //! ``` // Enable documentation for all features on docs.rs -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(rustls_native_certs_docsrs, feature(doc_cfg))] use std::error::Error as StdError; use std::path::{Path, PathBuf};