Skip to content

Commit

Permalink
docs: use doc_auto_cfg throughout
Browse files Browse the repository at this point in the history
Closes #3092.
  • Loading branch information
conorsch committed Jan 19, 2024
1 parent 40b2a45 commit 5f9719a
Show file tree
Hide file tree
Showing 38 changed files with 66 additions and 31 deletions.
3 changes: 2 additions & 1 deletion crates/bench/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@

// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
3 changes: 3 additions & 0 deletions crates/bin/pclientd/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

use std::net::SocketAddr;
use std::path::Path;

Expand Down
2 changes: 2 additions & 0 deletions crates/bin/pd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#![allow(clippy::clone_on_copy)]
#![deny(clippy::unwrap_used)]
#![recursion_limit = "512"]
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

mod consensus;
mod info;
Expand Down
2 changes: 2 additions & 0 deletions crates/cnidarium-component/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
//! appropriate times.
#![deny(clippy::unwrap_used)]
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

mod action_handler;
mod component;
Expand Down
2 changes: 2 additions & 0 deletions crates/core/app/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

mod action_handler;
mod community_pool_ext;
mod mock_client;
Expand Down
1 change: 1 addition & 0 deletions crates/core/asset/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
use once_cell::sync::Lazy;

pub mod asset;
Expand Down
3 changes: 1 addition & 2 deletions crates/core/component/chain/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

pub use epoch::Epoch;

Expand All @@ -8,7 +8,6 @@ mod epoch;
/// The substore prefix used for storing historic CometBFT block data.
pub static COMETBFT_SUBSTORE_PREFIX: &'static str = "cometbft-data";

#[cfg_attr(docsrs, doc(cfg(feature = "component")))]
#[cfg(feature = "component")]
pub mod component;

Expand Down
5 changes: 1 addition & 4 deletions crates/core/component/community-pool/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_cfg))]

#[cfg_attr(docsrs, doc(cfg(feature = "component")))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#[cfg(feature = "component")]
pub mod component;

Expand All @@ -13,6 +11,5 @@ pub use action::{CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend};
pub mod genesis;
pub mod params;

#[cfg_attr(docsrs, doc(cfg(feature = "component")))]
#[cfg(feature = "component")]
pub use component::{StateReadExt, StateWriteExt};
2 changes: 1 addition & 1 deletion crates/core/component/compact-block/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

#[cfg_attr(docsrs, doc(cfg(feature = "component")))]
#[cfg(feature = "component")]
Expand Down
5 changes: 2 additions & 3 deletions crates/core/component/dex/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_cfg))]

#[cfg_attr(docsrs, doc(cfg(feature = "component")))]
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#[cfg(feature = "component")]
pub mod component;
pub mod event;
Expand Down
4 changes: 1 addition & 3 deletions crates/core/component/distributions/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_cfg))]

#[cfg_attr(docsrs, doc(cfg(feature = "component")))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#[cfg(feature = "component")]
pub mod component;

Expand Down
2 changes: 1 addition & 1 deletion crates/core/component/fee/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

#[cfg_attr(docsrs, doc(cfg(feature = "component")))]
#[cfg(feature = "component")]
Expand Down
6 changes: 2 additions & 4 deletions crates/core/component/governance/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_cfg))]
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![recursion_limit = "512"]

pub mod delegator_vote;
Expand Down Expand Up @@ -42,15 +43,12 @@ pub mod state_key;
pub mod tally;
pub use tally::Tally;

#[cfg_attr(docsrs, doc(cfg(feature = "component")))]
#[cfg(feature = "component")]
pub mod component;

#[cfg_attr(docsrs, doc(cfg(feature = "component")))]
#[cfg(feature = "component")]
mod action_handler;

#[cfg_attr(docsrs, doc(cfg(feature = "component")))]
#[cfg(feature = "component")]
pub use component::{StateReadExt, StateWriteExt};

Expand Down
5 changes: 2 additions & 3 deletions crates/core/component/ibc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// marked as unreachable only when not building in test configuration.
#![deny(clippy::unwrap_used)]
#![allow(unreachable_patterns)]
#![cfg_attr(docsrs, feature(doc_cfg))]
// Requires nightly
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

#[cfg_attr(docsrs, doc(cfg(feature = "component")))]
#[cfg(feature = "component")]
pub mod component;
#[cfg(feature = "component")]
Expand All @@ -23,6 +23,5 @@ pub use prefix::{IBC_COMMITMENT_PREFIX, IBC_PROOF_SPECS, IBC_SUBSTORE_PREFIX};
pub use ibc_action::IbcRelay;
pub use ibc_token::IbcToken;

#[cfg_attr(docsrs, doc(cfg(feature = "component")))]
#[cfg(feature = "component")]
pub use component::{StateReadExt, StateWriteExt};
5 changes: 2 additions & 3 deletions crates/core/component/sct/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_cfg))]

#[cfg_attr(docsrs, doc(cfg(feature = "component")))]
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#[cfg(feature = "component")]
pub mod component;

Expand Down
4 changes: 1 addition & 3 deletions crates/core/component/shielded-pool/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_cfg))]

#[cfg_attr(docsrs, doc(cfg(feature = "component")))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#[cfg(feature = "component")]
pub mod component;

Expand Down
1 change: 1 addition & 0 deletions crates/core/component/stake/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Requires nightly
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![deny(clippy::unwrap_used)]
#![allow(clippy::clone_on_copy)]
Expand Down
3 changes: 3 additions & 0 deletions crates/core/keys/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#![deny(clippy::unwrap_used)]
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

use decaf377_fmd as fmd;
use decaf377_ka as ka;
use decaf377_rdsa as rdsa;
Expand Down
1 change: 1 addition & 0 deletions crates/core/num/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
mod amount;
pub mod fixpoint;

Expand Down
2 changes: 2 additions & 0 deletions crates/core/transaction/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#![deny(clippy::unwrap_used)]
#![allow(clippy::clone_on_copy)]
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

mod auth_data;
mod detection_data;
Expand Down
2 changes: 2 additions & 0 deletions crates/core/txhash/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
mod auth_hash;
mod context;
mod effect_hash;
Expand Down
2 changes: 2 additions & 0 deletions crates/crypto/decaf377-fmd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//!
//! [fmd]: https://protocol.penumbra.zone/main/crypto/fmd.html
#![deny(clippy::unwrap_used)]
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

mod clue;
mod clue_key;
Expand Down
3 changes: 3 additions & 0 deletions crates/crypto/decaf377-frost/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
//! This implementation only supports producing `SpendAuth` signatures, which
//! use the conventional `decaf377` basepoint.
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

use anyhow::anyhow;
use frost_core::frost;
use penumbra_proto::crypto::decaf377_frost::v1alpha1 as pb;
Expand Down
3 changes: 3 additions & 0 deletions crates/crypto/decaf377-ka/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#![deny(clippy::unwrap_used)]
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

use std::convert::{TryFrom, TryInto};

use ark_ff::UniformRand;
Expand Down
1 change: 1 addition & 0 deletions crates/crypto/eddy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
//!
//! [protocol-batching]: https://protocol.penumbra.zone/main/concepts/batching_flows.html
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

mod ciphertext;
mod decryption_share;
Expand Down
3 changes: 3 additions & 0 deletions crates/crypto/proof-params/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#![deny(clippy::unwrap_used)]
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

use anyhow::{bail, Result};
use ark_groth16::{PreparedVerifyingKey, ProvingKey, VerifyingKey};
use ark_serialize::CanonicalDeserialize;
Expand Down
2 changes: 2 additions & 0 deletions crates/crypto/proof-setup/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub mod all;
mod parallel_utils;
pub mod single;
1 change: 1 addition & 0 deletions crates/crypto/tct/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#![deny(clippy::unwrap_used)]
#![warn(missing_docs, rustdoc::broken_intra_doc_links)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

#[macro_use]
extern crate derivative;
Expand Down
2 changes: 2 additions & 0 deletions crates/custody/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
//! authorization or blind signing.
#![deny(clippy::unwrap_used)]
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#[macro_use]
extern crate serde_with;

Expand Down
1 change: 1 addition & 0 deletions crates/misc/tct-visualize/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#[macro_use]
extern crate serde;

Expand Down
1 change: 0 additions & 1 deletion crates/proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#![allow(clippy::needless_borrow)]
#![allow(clippy::unwrap_used)]
#![allow(non_snake_case)]
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

pub use prost::{Message, Name};
Expand Down
2 changes: 2 additions & 0 deletions crates/test/tct-property-test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
//! This is an empty crate that exists solely to contain property tests for the `penumbra_tct`
//! package, so we can isolate expensive tests and run them with different optimizations.
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
1 change: 1 addition & 0 deletions crates/util/tendermint-proxy/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
mod tendermint_proxy;
pub use tendermint_proxy::TendermintProxy;
2 changes: 2 additions & 0 deletions crates/util/tower-trace/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

/// A vendored copy of the unpublished `tracing-tower` crate.
pub mod trace;

Expand Down
2 changes: 2 additions & 0 deletions crates/view/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#![deny(clippy::unwrap_used)]
#![recursion_limit = "512"]
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
mod client;
mod metrics;
mod note_record;
Expand Down
1 change: 1 addition & 0 deletions crates/wallet/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(clippy::unwrap_used)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
mod build;
pub use build::build_transaction;

Expand Down
3 changes: 3 additions & 0 deletions crates/wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#![allow(dead_code)]
// Requires nightly.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

extern crate core;

pub mod build;
Expand Down
Loading

0 comments on commit 5f9719a

Please sign in to comment.