diff --git a/bitcoin/contrib/test.sh b/bitcoin/contrib/test.sh index 0dd15588cf..14698f4fcd 100755 --- a/bitcoin/contrib/test.sh +++ b/bitcoin/contrib/test.sh @@ -80,10 +80,17 @@ cargo run --example ecdsa-psbt --features=bitcoinconsensus cargo run --example taproot-psbt --features=rand-std,bitcoinconsensus # Build the docs if told to (this only works with the nightly toolchain) -if [ "$DO_DOCS" = true ]; then +if [ "$DO_DOCSRS" = true ]; then + # We use rustdoc so that we can check for broken links. RUSTDOCFLAGS="--cfg docsrs" cargo +nightly rustdoc --all-features -- -D rustdoc::broken-intra-doc-links -D warnings fi +# Build the docs with a stable toolchain, in unison with the DO_DOCSRS command +# above this checks that we feature guarded docs imports correctly. +if [ "$DO_DOCS" = true ]; then + cargo +stable doc --all-features +fi + # Fuzz if told to if [ "$DO_FUZZ" = true ] then diff --git a/hashes/contrib/test.sh b/hashes/contrib/test.sh index bdd3462f5d..6a340f0062 100755 --- a/hashes/contrib/test.sh +++ b/hashes/contrib/test.sh @@ -55,8 +55,15 @@ if [ "$DO_SCHEMARS_TESTS" = true ]; then fi # Build the docs if told to (this only works with the nightly toolchain) +if [ "$DO_DOCSRS" = true ]; then + # We use rustdoc so that we can check for broken links. + RUSTDOCFLAGS="--cfg docsrs" cargo +nightly rustdoc --all-features -- -D rustdoc::broken-intra-doc-links -D warnings +fi + +# Build the docs with a stable toolchain, in unison with the DO_DOCSRS command +# above this checks that we feature guarded docs imports correctly. if [ "$DO_DOCS" = true ]; then - RUSTDOCFLAGS="--cfg docsrs" cargo doc --features="$FEATURES" + cargo +stable doc --all-features fi # Webassembly stuff