Skip to content

Commit 92eafa9

Browse files
committed
Privatise docsrs cfg flag
Fixes a docs.rs build failure by following the same approach used in rustls, removing `doc_auto_cfg` and privatizing the docsrs cfg flag. ``` [INFO] [stderr] Documenting instant-acme v0.8.3 (/opt/rustwide/workdir) [INFO] [stderr] error[E0557]: feature has been removed [INFO] [stderr] --> src/lib.rs:5:38 [INFO] [stderr] | [INFO] [stderr] 5 | #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] [INFO] [stderr] | ^^^^^^^^^^^^ feature has been removed [INFO] [stderr] | [INFO] [stderr] = note: removed in CURRENT_RUSTC_VERSION; see <rust-lang/rust#138907> for more information [INFO] [stderr] = note: merged into `doc_cfg` [INFO] [stderr] [INFO] [stderr] error: Compilation failed, aborting rustdoc ```
1 parent be1807c commit 92eafa9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ required-features = ["hyper-rustls"]
6868
[package.metadata.docs.rs]
6969
# all non-default features except fips (cannot build on docs.rs environment)
7070
features = ["aws-lc-rs", "x509-parser", "time"]
71-
rustdoc-args = ["--cfg", "docsrs"]
71+
rustdoc-args = ["--cfg", "instant_acme_docsrs"]
7272

7373
[package.metadata.cargo_check_external_types]
7474
allowed_external_types = [
@@ -80,3 +80,6 @@ allowed_external_types = [
8080
"serde::*",
8181
"serde_json::*",
8282
]
83+
84+
[lints.rust]
85+
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(instant_acme_docsrs)"] }

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
#![warn(unreachable_pub)]
44
#![warn(missing_docs)]
5-
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
5+
#![cfg_attr(instant_acme_docsrs, feature(doc_cfg))]
66

77
use std::convert::Infallible;
88
use std::error::Error as StdError;

0 commit comments

Comments
 (0)