diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 300a7bab7..cf55d9a28 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -39,3 +39,18 @@ jobs: run: $HOME/.cargo/bin/cargo test --verbose --release --all - name: Run slow tests run: $HOME/.cargo/bin/cargo test --verbose --release --all -- --ignored + + doc-links: + name: Check intra-doc links + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + - uses: actions-rs/cargo@v1 + with: + command: doc + args: --document-private-items diff --git a/bellman/src/lib.rs b/bellman/src/lib.rs index 144510731..5152b0f10 100644 --- a/bellman/src/lib.rs +++ b/bellman/src/lib.rs @@ -1,3 +1,6 @@ +// Catch documentation errors caused by code changes. +#![deny(intra_doc_link_resolution_failure)] + #[cfg(feature = "multicore")] extern crate crossbeam; diff --git a/ff/src/lib.rs b/ff/src/lib.rs index fb692c2f3..456cbc1ca 100644 --- a/ff/src/lib.rs +++ b/ff/src/lib.rs @@ -1,3 +1,5 @@ +// Catch documentation errors caused by code changes. +#![deny(intra_doc_link_resolution_failure)] #![allow(unused_imports)] #[cfg(feature = "derive")] diff --git a/group/src/lib.rs b/group/src/lib.rs index 0d50f8a8e..be78b2aef 100644 --- a/group/src/lib.rs +++ b/group/src/lib.rs @@ -1,3 +1,6 @@ +// Catch documentation errors caused by code changes. +#![deny(intra_doc_link_resolution_failure)] + use ff::{PrimeField, PrimeFieldDecodingError, ScalarEngine, SqrtField}; use rand::RngCore; use std::error::Error; diff --git a/librustzcash/src/rustzcash.rs b/librustzcash/src/rustzcash.rs index e3a85e4aa..068b82467 100644 --- a/librustzcash/src/rustzcash.rs +++ b/librustzcash/src/rustzcash.rs @@ -1,3 +1,6 @@ +// Catch documentation errors caused by code changes. +#![deny(intra_doc_link_resolution_failure)] + use lazy_static; use ff::{PrimeField, PrimeFieldRepr}; diff --git a/pairing/src/lib.rs b/pairing/src/lib.rs index b5b46e31a..9f20a8808 100644 --- a/pairing/src/lib.rs +++ b/pairing/src/lib.rs @@ -8,6 +8,8 @@ #![cfg_attr(feature = "cargo-clippy", allow(clippy::many_single_char_names))] #![cfg_attr(feature = "cargo-clippy", allow(clippy::new_without_default))] #![cfg_attr(feature = "cargo-clippy", allow(clippy::write_literal))] +// Catch documentation errors caused by code changes. +#![deny(intra_doc_link_resolution_failure)] // Force public structures to implement Debug #![deny(missing_debug_implementations)] diff --git a/zcash_client_backend/src/lib.rs b/zcash_client_backend/src/lib.rs index 02de4b405..6d1d99353 100644 --- a/zcash_client_backend/src/lib.rs +++ b/zcash_client_backend/src/lib.rs @@ -3,6 +3,9 @@ //! `zcash_client_backend` contains Rust structs and traits for creating shielded Zcash //! light clients. +// Catch documentation errors caused by code changes. +#![deny(intra_doc_link_resolution_failure)] + pub mod constants; pub mod encoding; pub mod keys; diff --git a/zcash_primitives/src/lib.rs b/zcash_primitives/src/lib.rs index 644d7fb34..e8c2a518f 100644 --- a/zcash_primitives/src/lib.rs +++ b/zcash_primitives/src/lib.rs @@ -1,3 +1,6 @@ +// Catch documentation errors caused by code changes. +#![deny(intra_doc_link_resolution_failure)] + #[macro_use] extern crate lazy_static; diff --git a/zcash_proofs/src/lib.rs b/zcash_proofs/src/lib.rs index a83964abd..a323cc3a9 100644 --- a/zcash_proofs/src/lib.rs +++ b/zcash_proofs/src/lib.rs @@ -1,3 +1,6 @@ +// Catch documentation errors caused by code changes. +#![deny(intra_doc_link_resolution_failure)] + use bellman::groth16::{prepare_verifying_key, Parameters, PreparedVerifyingKey, VerifyingKey}; use pairing::bls12_381::Bls12; use std::fs::File;