Skip to content

Commit 2433414

Browse files
committed
Enable build of docs with doc_auto_cfg
Use the recently learned about `doc_auto_cfg` feature and enable it using a custom `docsrs` compiler conditional configuration option. Fix and improve the rustdocs while we are at it. Add docs build to CI script but do not enable it in the github actions yet. Fix: #75
1 parent 158e315 commit 2433414

File tree

2 files changed

+102
-60
lines changed

2 files changed

+102
-60
lines changed

contrib/test.sh

+11
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,15 @@ if [ "${DO_FEATURE_MATRIX-false}" = true ]; then
6060
fi
6161
fi
6262

63+
# Build the docs if told to (this only works with the nightly toolchain)
64+
if [ "${DO_DOCSRS-false}" = true ]; then
65+
RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +nightly doc --all-features
66+
fi
67+
68+
# Build the docs with a stable toolchain, in unison with the DO_DOCSRS command
69+
# above this checks that we feature guarded docs imports correctly.
70+
if [ "${DO_DOCS-false}" = true ]; then
71+
RUSTDOCFLAGS="-D warnings" cargo +stable doc --all-features
72+
fi
73+
6374
exit 0

0 commit comments

Comments
 (0)