Skip to content

Commit 7520286

Browse files
committed
chore(docsrs): make docs.rs build work
The nightly feature has been removed in rust 1.92, see docs.rs build failure https://docs.rs/crate/rustls-native-certs/latest/builds/2773223 and rust PR rust-lang/rust#138907. Also, renamed the cfg into `rustls_native_certs_docsrs`. See rustls/rustls#2682 for more info.
1 parent 72c6a1a commit 7520286

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ jobs:
142142
- name: cargo doc (rustls; all features)
143143
run: cargo doc --locked --all-features --no-deps --document-private-items
144144
env:
145-
RUSTDOCFLAGS: -Dwarnings
145+
RUSTDOCFLAGS: -Dwarnings --cfg=rustls_native_certs_docsrs
146146

147147
format:
148148
name: Format

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ openssl-probe = "0.2"
3232

3333
[target.'cfg(target_os = "macos")'.dependencies]
3434
security-framework = "3"
35+
36+
[lints.rust]
37+
unexpected_cfgs = { level = "warn", check-cfg = [ 'cfg(rustls_native_certs_docsrs)' ] }
38+
39+
[package.metadata.docs.rs]
40+
rustdoc-args = ["--cfg", "rustls_native_certs_docsrs"]

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
//! ```
2020
2121
// Enable documentation for all features on docs.rs
22-
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
22+
#![cfg_attr(rustls_native_certs_docsrs, feature(doc_cfg))]
2323

2424
use std::error::Error as StdError;
2525
use std::path::{Path, PathBuf};

0 commit comments

Comments
 (0)