From e32281dac2a5c3f90d46bf52661e5cc9c2517d5e Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Sat, 12 Oct 2024 16:26:06 +0400 Subject: [PATCH] add doc_auto_cfg to relevant sdk crates (#3121) --- sdk/account-info/Cargo.toml | 2 ++ sdk/account-info/src/lib.rs | 2 +- sdk/account/Cargo.toml | 2 ++ sdk/account/src/lib.rs | 1 + sdk/hash/Cargo.toml | 2 ++ sdk/hash/src/lib.rs | 1 + sdk/instruction/Cargo.toml | 2 ++ sdk/instruction/src/lib.rs | 1 + sdk/program-error/Cargo.toml | 2 ++ sdk/program-error/src/lib.rs | 1 + sdk/pubkey/Cargo.toml | 2 ++ sdk/pubkey/src/lib.rs | 1 + sdk/signature/Cargo.toml | 2 ++ sdk/signature/src/lib.rs | 1 + 14 files changed, 21 insertions(+), 1 deletion(-) diff --git a/sdk/account-info/Cargo.toml b/sdk/account-info/Cargo.toml index 55dc3d8a30ef44..4ba7d4733775d8 100644 --- a/sdk/account-info/Cargo.toml +++ b/sdk/account-info/Cargo.toml @@ -21,3 +21,5 @@ bincode = ["dep:bincode", "dep:serde"] [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] +all-features = true +rustdoc-args = ["--cfg=docsrs"] diff --git a/sdk/account-info/src/lib.rs b/sdk/account-info/src/lib.rs index aed2b36669ad86..d063e600a1a3da 100644 --- a/sdk/account-info/src/lib.rs +++ b/sdk/account-info/src/lib.rs @@ -1,5 +1,5 @@ //! Account information. - +#![cfg_attr(docsrs, feature(doc_auto_cfg))] use { solana_program_error::ProgramError, solana_program_memory::sol_memset, diff --git a/sdk/account/Cargo.toml b/sdk/account/Cargo.toml index 33d210778f08e5..015736eebe08c4 100644 --- a/sdk/account/Cargo.toml +++ b/sdk/account/Cargo.toml @@ -36,3 +36,5 @@ serde = ["dep:serde", "dep:serde_bytes", "dep:serde_derive"] [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] +all-features = true +rustdoc-args = ["--cfg=docsrs"] diff --git a/sdk/account/src/lib.rs b/sdk/account/src/lib.rs index c2bcbbfd02c916..762e41a5dd5abf 100644 --- a/sdk/account/src/lib.rs +++ b/sdk/account/src/lib.rs @@ -1,4 +1,5 @@ #![cfg_attr(feature = "frozen-abi", feature(min_specialization))] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] //! The Solana [`Account`] type. #[cfg(feature = "dev-context-only-utils")] diff --git a/sdk/hash/Cargo.toml b/sdk/hash/Cargo.toml index ecf502e0ba243d..7db31fdf5929da 100644 --- a/sdk/hash/Cargo.toml +++ b/sdk/hash/Cargo.toml @@ -11,6 +11,8 @@ edition = { workspace = true } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] +all-features = true +rustdoc-args = ["--cfg=docsrs"] [dependencies] borsh = { workspace = true, optional = true } diff --git a/sdk/hash/src/lib.rs b/sdk/hash/src/lib.rs index c5cad6f58a5861..0471fff3c48ec1 100644 --- a/sdk/hash/src/lib.rs +++ b/sdk/hash/src/lib.rs @@ -1,4 +1,5 @@ #![no_std] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #[cfg(feature = "borsh")] use borsh::{BorshDeserialize, BorshSchema, BorshSerialize}; diff --git a/sdk/instruction/Cargo.toml b/sdk/instruction/Cargo.toml index 0f96abda001702..5826fca227ff20 100644 --- a/sdk/instruction/Cargo.toml +++ b/sdk/instruction/Cargo.toml @@ -49,6 +49,8 @@ std = [] [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] +all-features = true +rustdoc-args = ["--cfg=docsrs"] [lints] workspace = true diff --git a/sdk/instruction/src/lib.rs b/sdk/instruction/src/lib.rs index 8627a204bb41d8..b94ebf9df7ea2d 100644 --- a/sdk/instruction/src/lib.rs +++ b/sdk/instruction/src/lib.rs @@ -10,6 +10,7 @@ //! while executing a given instruction is also included in `Instruction`, as //! [`AccountMeta`] values. The runtime uses this information to efficiently //! schedule execution of transactions. +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] #![no_std] diff --git a/sdk/program-error/Cargo.toml b/sdk/program-error/Cargo.toml index 64860dee0a0331..8e864d309bc5f8 100644 --- a/sdk/program-error/Cargo.toml +++ b/sdk/program-error/Cargo.toml @@ -27,3 +27,5 @@ serde = ["dep:serde", "dep:serde_derive"] [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] +all-features = true +rustdoc-args = ["--cfg=docsrs"] diff --git a/sdk/program-error/src/lib.rs b/sdk/program-error/src/lib.rs index 87c79595bd688a..947c47f6cfd5b6 100644 --- a/sdk/program-error/src/lib.rs +++ b/sdk/program-error/src/lib.rs @@ -1,6 +1,7 @@ //! The [`ProgramError`] type and related definitions. #![allow(clippy::arithmetic_side_effects)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #[cfg(feature = "borsh")] use borsh::io::Error as BorshIoError; #[cfg(feature = "serde")] diff --git a/sdk/pubkey/Cargo.toml b/sdk/pubkey/Cargo.toml index 64260e6f085191..b34d214388a269 100644 --- a/sdk/pubkey/Cargo.toml +++ b/sdk/pubkey/Cargo.toml @@ -75,6 +75,8 @@ std = [] [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] +all-features = true +rustdoc-args = ["--cfg=docsrs"] [lints] workspace = true diff --git a/sdk/pubkey/src/lib.rs b/sdk/pubkey/src/lib.rs index c29e3654c396e7..7f3cd3fd8edf87 100644 --- a/sdk/pubkey/src/lib.rs +++ b/sdk/pubkey/src/lib.rs @@ -1,5 +1,6 @@ //! Solana account addresses. #![no_std] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] diff --git a/sdk/signature/Cargo.toml b/sdk/signature/Cargo.toml index 989200b9281b61..b01518d9692d8e 100644 --- a/sdk/signature/Cargo.toml +++ b/sdk/signature/Cargo.toml @@ -43,6 +43,8 @@ verify = ["dep:ed25519-dalek"] [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] +all-features = true +rustdoc-args = ["--cfg=docsrs"] [lints] workspace = true diff --git a/sdk/signature/src/lib.rs b/sdk/signature/src/lib.rs index 1521391824a8da..7e793d75603cf1 100644 --- a/sdk/signature/src/lib.rs +++ b/sdk/signature/src/lib.rs @@ -1,5 +1,6 @@ //! 64-byte signature type. #![no_std] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #[cfg(any(test, feature = "verify"))] use core::convert::TryInto;