Skip to content

Commit fc5c98d

Browse files
committed
Rely on docs.rs to define --cfg=docsrs by default
1 parent 69efd3c commit fc5c98d

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ doc-scrape-examples = false
2323

2424
[package.metadata.docs.rs]
2525
targets = ["x86_64-unknown-linux-gnu"]
26-
rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition"]
26+
rustdoc-args = ["--generate-link-to-definition"]

build.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ fn main() {
1111
};
1212

1313
if compiler >= 80 {
14-
println!("cargo:rustc-check-cfg=cfg(doc_cfg)");
1514
println!("cargo:rustc-check-cfg=cfg(no_alloc_crate)");
1615
println!("cargo:rustc-check-cfg=cfg(no_const_vec_new)");
1716
println!("cargo:rustc-check-cfg=cfg(no_exhaustive_int_match)");

src/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub(crate) enum Position {
2626
}
2727

2828
#[cfg(feature = "std")]
29-
#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]
29+
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
3030
impl std::error::Error for Error {}
3131

3232
impl Display for Error {

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
//! [Specifying Dependencies]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html
6262
6363
#![doc(html_root_url = "https://docs.rs/semver/1.0.23")]
64-
#![cfg_attr(doc_cfg, feature(doc_cfg))]
64+
#![cfg_attr(docsrs, feature(doc_cfg))]
6565
#![cfg_attr(all(not(feature = "std"), not(no_alloc_crate)), no_std)]
6666
#![cfg_attr(not(no_unsafe_op_in_unsafe_fn_lint), deny(unsafe_op_in_unsafe_fn))]
6767
#![cfg_attr(no_unsafe_op_in_unsafe_fn_lint, allow(unused_unsafe))]

0 commit comments

Comments
 (0)