diff --git a/lightning-background-processor/Cargo.toml b/lightning-background-processor/Cargo.toml index 1837cb17e66..0341cd5aedc 100644 --- a/lightning-background-processor/Cargo.toml +++ b/lightning-background-processor/Cargo.toml @@ -9,6 +9,10 @@ Utilities to perform required background tasks for Rust Lightning. """ edition = "2018" +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [dependencies] bitcoin = "0.27" lightning = { version = "0.0.104", path = "../lightning", features = ["std"] } diff --git a/lightning-background-processor/src/lib.rs b/lightning-background-processor/src/lib.rs index 8ed0014a72d..f2058b108ce 100644 --- a/lightning-background-processor/src/lib.rs +++ b/lightning-background-processor/src/lib.rs @@ -6,6 +6,8 @@ #![deny(missing_docs)] #![deny(unsafe_code)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + #[macro_use] extern crate lightning; use lightning::chain; diff --git a/lightning-block-sync/Cargo.toml b/lightning-block-sync/Cargo.toml index 0a395e8b99d..3a7d57956af 100644 --- a/lightning-block-sync/Cargo.toml +++ b/lightning-block-sync/Cargo.toml @@ -9,6 +9,10 @@ Utilities to fetch the chain data from a block source and feed them into Rust Li """ edition = "2018" +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [features] rest-client = [ "serde", "serde_json", "chunked_transfer" ] rpc-client = [ "serde", "serde_json", "chunked_transfer" ] diff --git a/lightning-block-sync/src/convert.rs b/lightning-block-sync/src/convert.rs index 358076f4c25..8023c837519 100644 --- a/lightning-block-sync/src/convert.rs +++ b/lightning-block-sync/src/convert.rs @@ -182,7 +182,7 @@ impl TryInto for JsonResponse { } /// Converts a JSON value into a transaction. WATCH OUT! this cannot be used for zero-input transactions -/// (e.g. createrawtransaction). See https://github.com/rust-bitcoin/rust-bitcoincore-rpc/issues/197 +/// (e.g. createrawtransaction). See impl TryInto for JsonResponse { type Error = std::io::Error; fn try_into(self) -> std::io::Result { diff --git a/lightning-block-sync/src/lib.rs b/lightning-block-sync/src/lib.rs index ac031132a71..8854aa3e8e4 100644 --- a/lightning-block-sync/src/lib.rs +++ b/lightning-block-sync/src/lib.rs @@ -17,6 +17,8 @@ #![deny(missing_docs)] #![deny(unsafe_code)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + #[cfg(any(feature = "rest-client", feature = "rpc-client"))] pub mod http; diff --git a/lightning-invoice/Cargo.toml b/lightning-invoice/Cargo.toml index e1f33f0fa26..3c2678bdc91 100644 --- a/lightning-invoice/Cargo.toml +++ b/lightning-invoice/Cargo.toml @@ -8,6 +8,10 @@ license = "MIT OR Apache-2.0" keywords = [ "lightning", "bitcoin", "invoice", "BOLT11" ] readme = "README.md" +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [features] default = ["std"] no-std = ["hashbrown", "lightning/no-std", "core2/alloc"] diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index d676f6c28d6..841e3f9c695 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -5,6 +5,8 @@ #![deny(unused_mut)] #![deny(broken_intra_doc_links)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + #![cfg_attr(feature = "strict", deny(warnings))] #![cfg_attr(all(not(feature = "std"), not(test)), no_std)] diff --git a/lightning-net-tokio/Cargo.toml b/lightning-net-tokio/Cargo.toml index 370e3cc4261..2b495a117b5 100644 --- a/lightning-net-tokio/Cargo.toml +++ b/lightning-net-tokio/Cargo.toml @@ -10,6 +10,10 @@ For Rust-Lightning clients which wish to make direct connections to Lightning P2 """ edition = "2018" +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [dependencies] bitcoin = "0.27" lightning = { version = "0.0.104", path = "../lightning" } diff --git a/lightning-net-tokio/src/lib.rs b/lightning-net-tokio/src/lib.rs index 62c036b9796..2582cc597f2 100644 --- a/lightning-net-tokio/src/lib.rs +++ b/lightning-net-tokio/src/lib.rs @@ -69,6 +69,8 @@ #![deny(broken_intra_doc_links)] #![deny(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + use bitcoin::secp256k1::key::PublicKey; use tokio::net::TcpStream; diff --git a/lightning-persister/Cargo.toml b/lightning-persister/Cargo.toml index 79ffeeeb281..cb056a60fad 100644 --- a/lightning-persister/Cargo.toml +++ b/lightning-persister/Cargo.toml @@ -8,6 +8,10 @@ description = """ Utilities to manage Rust-Lightning channel data persistence and retrieval. """ +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [features] _bench_unstable = ["lightning/_bench_unstable"] diff --git a/lightning-persister/src/lib.rs b/lightning-persister/src/lib.rs index 558f4b8fe3c..a5cbe2f9213 100644 --- a/lightning-persister/src/lib.rs +++ b/lightning-persister/src/lib.rs @@ -3,6 +3,8 @@ #![deny(broken_intra_doc_links)] #![deny(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + #![cfg_attr(all(test, feature = "_bench_unstable"), feature(test))] #[cfg(all(test, feature = "_bench_unstable"))] extern crate test; diff --git a/lightning/Cargo.toml b/lightning/Cargo.toml index 5f6f2ef655d..058a3b4f7c8 100644 --- a/lightning/Cargo.toml +++ b/lightning/Cargo.toml @@ -10,6 +10,10 @@ Does most of the hard work, without implying a specific runtime, requiring clien Still missing tons of error-handling. See GitHub issues for suggested projects if you want to contribute. Don't have to bother telling you not to use this for anything serious, because you'd have to build a client around it to even try. """ +[package.metadata.docs.rs] +features = ["std"] +rustdoc-args = ["--cfg", "docsrs"] + [features] # Internal test utilities exposed to other repo crates _test_utils = ["hex", "regex", "bitcoin/bitcoinconsensus"] diff --git a/lightning/src/lib.rs b/lightning/src/lib.rs index 2798f78adf2..6d4cc50a920 100644 --- a/lightning/src/lib.rs +++ b/lightning/src/lib.rs @@ -28,6 +28,8 @@ #![allow(bare_trait_objects)] #![allow(ellipsis_inclusive_range_patterns)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + #![cfg_attr(all(not(feature = "std"), not(test)), no_std)] #![cfg_attr(all(any(test, feature = "_test_utils"), feature = "_bench_unstable"), feature(test))] diff --git a/lightning/src/routing/scoring.rs b/lightning/src/routing/scoring.rs index b02b61fa9f6..dfda3d2f867 100644 --- a/lightning/src/routing/scoring.rs +++ b/lightning/src/routing/scoring.rs @@ -246,7 +246,6 @@ type ConfiguredTime = time::Eternity; /// [`Score`] implementation. /// /// (C-not exported) generally all users should use the [`Scorer`] type alias. -#[doc(hidden)] pub struct ScorerUsingTime { params: ScoringParameters, // TODO: Remove entries of closed channels. @@ -493,7 +492,6 @@ pub type ProbabilisticScorer = ProbabilisticScorerUsingTime::, T: Time> { params: ProbabilisticScoringParameters, network_graph: G, diff --git a/lightning/src/util/events.rs b/lightning/src/util/events.rs index 8c9f5af4c0b..3b90015cab9 100644 --- a/lightning/src/util/events.rs +++ b/lightning/src/util/events.rs @@ -235,7 +235,7 @@ pub enum Event { /// Note that this does *not* indicate that all paths for an MPP payment have failed, see /// [`Event::PaymentFailed`] and [`all_paths_failed`]. /// - /// [`all_paths_failed`]: Self::all_paths_failed + /// [`all_paths_failed`]: Self::PaymentPathFailed::all_paths_failed PaymentPathFailed { /// The id returned by [`ChannelManager::send_payment`] and used with /// [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].