Skip to content

Commit aad409f

Browse files
committed
Fix cfg information in Rust docs
- support building Rust docs for docs.rs in `Makefile`
1 parent 73b2c81 commit aad409f

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ jobs:
167167
- uses: actions-rs/toolchain@v1
168168
with:
169169
profile: minimal
170-
toolchain: stable
170+
toolchain: nightly
171171

172-
- run: make cargo.doc private=yes open=no
172+
- run: make cargo.doc private=yes docsrs=yes open=no
173173

174174

175175

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@ test: test.cargo
4040
# Generate crate documentation from Rust sources.
4141
#
4242
# Usage:
43-
# make cargo.doc [private=(yes|no)]
43+
# make cargo.doc [private=(yes|no)] [docsrs=(no|yes)]
4444
# [open=(yes|no)] [clean=(no|yes)]
4545

4646
cargo.doc:
4747
ifeq ($(clean),yes)
4848
@rm -rf target/doc/
4949
endif
50-
cargo doc -p cucumber-expressions --all-features \
50+
$(if $(call eq,$(docsrs),yes),RUSTDOCFLAGS='--cfg docsrs',) \
51+
cargo $(if $(call eq,$(docsrs),yes),+nightly,) doc -p cucumber-expressions \
52+
--all-features \
5153
$(if $(call eq,$(private),no),,--document-private-items) \
5254
$(if $(call eq,$(open),no),,--open)
5355

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
unused_results,
112112
variant_size_differences
113113
)]
114-
#![cfg_attr(docsrs, feature(doc_cfg))]
114+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
115115

116116
pub mod ast;
117117
mod combinator;

0 commit comments

Comments
 (0)