From 18a096775849e8f10457a4b0c51721f1227909b0 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 17 Mar 2021 14:05:09 -0400 Subject: [PATCH] Enforce doc link correctness during `cargo doc` runs and in CI --- background-processor/src/lib.rs | 3 +++ ci/check-compiles.sh | 1 + lightning-block-sync/src/lib.rs | 3 +++ lightning-net-tokio/src/lib.rs | 3 +++ lightning-persister/src/lib.rs | 2 ++ lightning/src/lib.rs | 1 + 6 files changed, 13 insertions(+) diff --git a/background-processor/src/lib.rs b/background-processor/src/lib.rs index f6c2dbfca..23c18623d 100644 --- a/background-processor/src/lib.rs +++ b/background-processor/src/lib.rs @@ -1,3 +1,6 @@ +#![deny(broken_intra_doc_links)] +#![deny(unsafe_code)] + #[macro_use] extern crate lightning; use lightning::chain; diff --git a/ci/check-compiles.sh b/ci/check-compiles.sh index 177765fb9..45ade5c6a 100755 --- a/ci/check-compiles.sh +++ b/ci/check-compiles.sh @@ -3,4 +3,5 @@ set -e set -x echo Testing $(git log -1 --oneline) cargo check +cargo doc cd fuzz && cargo check --features=stdin_fuzz diff --git a/lightning-block-sync/src/lib.rs b/lightning-block-sync/src/lib.rs index db536fe7d..96f811d3e 100644 --- a/lightning-block-sync/src/lib.rs +++ b/lightning-block-sync/src/lib.rs @@ -16,6 +16,9 @@ //! [`SpvClient`]: struct.SpvClient.html //! [`BlockSource`]: trait.BlockSource.html +#![deny(broken_intra_doc_links)] +#![deny(unsafe_code)] + #[cfg(any(feature = "rest-client", feature = "rpc-client"))] pub mod http; diff --git a/lightning-net-tokio/src/lib.rs b/lightning-net-tokio/src/lib.rs index 9dc99e477..74da58dad 100644 --- a/lightning-net-tokio/src/lib.rs +++ b/lightning-net-tokio/src/lib.rs @@ -72,6 +72,9 @@ //! } //! ``` +#![deny(broken_intra_doc_links)] +#![deny(missing_docs)] + use bitcoin::secp256k1::key::PublicKey; use tokio::net::TcpStream; diff --git a/lightning-persister/src/lib.rs b/lightning-persister/src/lib.rs index 2226bcba6..1b343ce16 100644 --- a/lightning-persister/src/lib.rs +++ b/lightning-persister/src/lib.rs @@ -1,3 +1,5 @@ +#![deny(broken_intra_doc_links)] + mod util; extern crate lightning; diff --git a/lightning/src/lib.rs b/lightning/src/lib.rs index 567a7e186..2d764c8b7 100644 --- a/lightning/src/lib.rs +++ b/lightning/src/lib.rs @@ -20,6 +20,7 @@ #![cfg_attr(not(any(feature = "fuzztarget", feature = "_test_utils")), deny(missing_docs))] #![cfg_attr(not(any(test, feature = "fuzztarget", feature = "_test_utils")), forbid(unsafe_code))] +#![deny(broken_intra_doc_links)] // In general, rust is absolutely horrid at supporting users doing things like, // for example, compiling Rust code for real environments. Disable useless lints -- 2.39.5