Skip to content

Commit 935bc12

Browse files
committed
chore(docsrs): change the cfg flag to rustls_native_certs_docsrs
See rustls/rustls#2682
1 parent bd3b858 commit 935bc12

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/rust.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ permissions:
55

66
on:
77
push:
8-
branches: ['main', 'ci/*']
8+
branches: ["main", "ci/*"]
99
pull_request:
1010
merge_group:
1111
schedule:
12-
- cron: '0 18 * * *'
12+
- cron: "0 18 * * *"
1313
workflow_dispatch:
1414

1515
jobs:
@@ -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))]
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)