Skip to content

Commit

Permalink
Enable feature(doc_cfg) during docs.rs documentation build
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Nov 6, 2023
1 parent edb1a58 commit 0726b2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion serde/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ features = ["derive", "rc"]
[package.metadata.docs.rs]
features = ["derive"]
targets = ["x86_64-unknown-linux-gnu"]
rustdoc-args = ["--generate-link-to-definition"]
rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition"]

# This cfg cannot be enabled, but it still forces Cargo to keep serde_derive's
# version in lockstep with serde's, even if someone depends on the two crates
Expand Down
2 changes: 2 additions & 0 deletions serde/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
#![doc(html_root_url = "https://docs.rs/serde/1.0.190")]
// Support using Serde without the standard library!
#![cfg_attr(not(feature = "std"), no_std)]
// Show which crate feature enables conditionally compiled APIs in documentation.
#![cfg_attr(doc_cfg, feature(doc_cfg))]
// Unstable functionality only if the user asks for it. For tracking and
// discussion of these features please refer to this issue:
//
Expand Down

0 comments on commit 0726b2c

Please sign in to comment.