Skip to content

Commit 785edcc

Browse files
committed
Avoid use of docsrs cfg
cfg is a global namespace, and we don't want to trigger this in dependencies.
1 parent 4e836cf commit 785edcc

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
- name: cargo doc (all features)
8888
run: cargo doc --locked --all-features --document-private-items
8989
env:
90-
RUSTDOCFLAGS: ${{ matrix.rust_channel == 'nightly' && '-Dwarnings --cfg=docsrs' || '-Dwarnings' }}
90+
RUSTDOCFLAGS: ${{ matrix.rust_channel == 'nightly' && '-Dwarnings --cfg=webpki_docsrs' || '-Dwarnings' }}
9191

9292
package:
9393
name: Cargo Package

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ include = [
5858

5959
[package.metadata.docs.rs]
6060
all-features = true
61-
rustdoc-args = ["--cfg", "docsrs"]
61+
rustdoc-args = ["--cfg", "webpki_docsrs"]
6262

6363
[package.metadata.cargo_check_external_types]
6464
allowed_external_types = [
@@ -116,3 +116,6 @@ harness = false
116116

117117
[package.metadata.cargo-semver-checks.lints]
118118
enum_variant_marked_deprecated = "warn"
119+
120+
[lints.rust]
121+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(webpki_docsrs)'] }

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
clippy::upper_case_acronyms
4545
)]
4646
// Enable documentation for all features on docs.rs
47-
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
47+
#![cfg_attr(webpki_docsrs, feature(doc_cfg, doc_auto_cfg))]
4848

4949
#[cfg(any(feature = "std", test))]
5050
extern crate std;

0 commit comments

Comments
 (0)