Skip to content

Commit eacf0a5

Browse files
committed
syntax: enable 'doc_auto_cfg'
I wish this feature were stable and enabled by default. I suspect that it maybe doesn't work correctly 100% of the time, but it's super useful. And manually annotating APIs is a huge pain, so it's worth at least attempting.
1 parent 314ce0a commit eacf0a5

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

regex-syntax/Cargo.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,16 @@ unicode-gencat = []
3232
unicode-perl = []
3333
unicode-script = []
3434
unicode-segment = []
35+
36+
[package.metadata.docs.rs]
37+
# We want to document all features.
38+
all-features = true
39+
# Since this crate's feature setup is pretty complicated, it is worth opting
40+
# into a nightly unstable option to show the features that need to be enabled
41+
# for public API items. To do that, we set 'docsrs', and when that's enabled,
42+
# we enable the 'doc_auto_cfg' feature.
43+
#
44+
# To test this locally, run:
45+
#
46+
# RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
47+
rustdoc-args = ["--cfg", "docsrs"]

regex-syntax/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ The following features are available:
162162
#![forbid(unsafe_code)]
163163
#![deny(missing_docs)]
164164
#![warn(missing_debug_implementations)]
165+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
165166
#![no_std]
166167

167168
#[cfg(any(test, feature = "std"))]

0 commit comments

Comments
 (0)