Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing_debug_implementations for some crates #1407

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion async-signature/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms, unused_qualifications)]
#![warn(
missing_docs,
rust_2018_idioms,
unused_qualifications,
missing_debug_implementations
)]

pub use signature::{self, Error};

Expand Down
7 changes: 6 additions & 1 deletion cipher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
)]
#![warn(missing_docs, rust_2018_idioms, unused_lifetimes)]
#![warn(
missing_docs,
rust_2018_idioms,
unused_lifetimes,
missing_debug_implementations
)]

pub use crypto_common;
pub use inout;
Expand Down
2 changes: 1 addition & 1 deletion crypto-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
)]
#![forbid(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms)]
#![warn(missing_docs, rust_2018_idioms, missing_debug_implementations)]

#[cfg(feature = "std")]
extern crate std;
Expand Down
2 changes: 1 addition & 1 deletion crypto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg"
)]
#![forbid(unsafe_code)]
#![warn(rust_2018_idioms)]
#![warn(rust_2018_idioms, missing_debug_implementations)]

pub use crypto_common as common;

Expand Down
11 changes: 11 additions & 0 deletions digest/src/core_api/ct_variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,17 @@ where
const OID: ObjectIdentifier = O::OID;
}

impl<T, OutSize, O> fmt::Debug for CtVariableCoreWrapper<T, OutSize, O>
where
T: VariableOutputCore + AlgorithmName,
OutSize: ArraySize + IsLessOrEqual<T::OutputSize>,
LeEq<OutSize, T::OutputSize>: NonZero,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Self::write_alg_name(f)
}
}

/// Implement dummy type with hidden docs which is used to "carry" hasher
/// OID for [`CtVariableCoreWrapper`].
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion digest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
)]
#![warn(missing_docs, rust_2018_idioms)]
#![warn(missing_docs, rust_2018_idioms, missing_debug_implementations)]

#[cfg(feature = "alloc")]
#[macro_use]
Expand Down
6 changes: 6 additions & 0 deletions digest/src/mac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ impl<T: OutputSizeUser> PartialEq for CtOutput<T> {

impl<T: OutputSizeUser> Eq for CtOutput<T> {}

impl<T: OutputSizeUser> fmt::Debug for CtOutput<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("CtOutput { ... }")
}
}

/// Error type for when the [`Output`] of a [`Mac`]
/// is not equal to the expected value.
#[derive(Default, Debug, Copy, Clone, Eq, PartialEq)]
Expand Down
10 changes: 8 additions & 2 deletions kem/src/kem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

use crate::errors::Error;

use core::fmt::Debug;
use core::fmt;

use generic_array::{ArrayLength, GenericArray};
use rand_core::{CryptoRng, RngCore};
use zeroize::{Zeroize, ZeroizeOnDrop};

/// Trait impl'd by concrete types that represent an encapsulated key. This is intended to be, in
/// essence, a bag of bytes.
pub trait EncappedKey: AsRef<[u8]> + Debug + Sized {
pub trait EncappedKey: AsRef<[u8]> + fmt::Debug + Sized {
/// The size, in bytes, of an encapsulated key.
type EncappedKeySize: ArrayLength<u8>;

Expand Down Expand Up @@ -38,6 +38,12 @@ pub trait EncappedKey: AsRef<[u8]> + Debug + Sized {
/// The shared secret that results from key exchange.
pub struct SharedSecret<EK: EncappedKey>(GenericArray<u8, EK::SharedSecretSize>);

impl<EK: EncappedKey> fmt::Debug for SharedSecret<EK> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("SharedSecret { ... }")
}
}

// Zero the secret on drop
impl<EK: EncappedKey> Drop for SharedSecret<EK> {
fn drop(&mut self) {
Expand Down
2 changes: 1 addition & 1 deletion kem/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
html_root_url = "https://docs.rs/kem"
)]
#![forbid(unsafe_code)]
#![warn(missing_docs, unused_qualifications)]
#![warn(missing_docs, unused_qualifications, missing_debug_implementations)]

#[cfg(feature = "std")]
extern crate std;
Expand Down
7 changes: 6 additions & 1 deletion password-hash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg"
)]
#![forbid(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms, unused_lifetimes)]
#![warn(
missing_docs,
rust_2018_idioms,
unused_lifetimes,
missing_debug_implementations
)]

//!
//! # Usage
Expand Down
1 change: 1 addition & 0 deletions password-hash/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ impl fmt::Debug for ParamsString {
}

/// Iterator over algorithm parameters stored in a [`ParamsString`] struct.
#[derive(Debug)]
pub struct Iter<'a> {
inner: Option<str::Split<'a, char>>,
}
Expand Down
1 change: 1 addition & 0 deletions signature/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
missing_docs,
rust_2018_idioms,
unused_lifetimes,
missing_debug_implementations,
unused_qualifications
)]

Expand Down
1 change: 1 addition & 0 deletions signature_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
rust_2018_idioms,
trivial_casts,
unused_import_braces,
missing_debug_implementations,
unused_qualifications
)]

Expand Down
2 changes: 1 addition & 1 deletion universal-hash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg"
)]
#![forbid(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms)]
#![warn(missing_docs, rust_2018_idioms, missing_debug_implementations)]

#[cfg(feature = "std")]
extern crate std;
Expand Down