docs(hashes): replace deprecated GeneralHash references
What changed, and why it matters
This commit only updates documentation comments and a test comment in the rust-bitcoin hashes crate. It replaces outdated references to a removed 'GeneralHash' trait with descriptions of the actual current requirements. There are no code behavior changes.
No security action needed. This is a documentation-only cleanup commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies two files in hashes/src/internal_macros.rs and hashes/tests/api.rs. All changes are comment-only: macro documentation for hash_trait_impls! and general_hash_type! now describe required methods/traits instead of the deprecated GeneralHash trait, and a test comment is updated. No executable code, logic, trait bounds, or APIs were changed.
Changed components
hashes/src/internal_macros.rshashes/tests/api.rsInspect captured patch +3 / −3
diff --git a/hashes/src/internal_macros.rs b/hashes/src/internal_macros.rs
index a837225a..1f6a8a0d 100644
--- a/hashes/src/internal_macros.rs
+++ b/hashes/src/internal_macros.rs
@@ -15,7 +15,7 @@
///
/// Restrictions on usage:
///
-/// * The hash type must implement the `GeneralHash` trait.
+/// * The `Hash` type in scope must provide `from_byte_array`, `to_byte_array`, and `as_byte_array` (e.g., via `hash_type_no_default!`).
macro_rules! hash_trait_impls {
($bits:expr, $reverse:expr $(, $gen:ident: $gent:ident)*) => {
$crate::impl_bytelike_traits!(Hash, { $bits / 8 } $(, $gen: $gent)*);
@@ -55,7 +55,7 @@ pub(crate) use hash_trait_impls;
///
/// Restrictions on usage:
///
-/// * The hash type must implement the `GeneralHash` trait.
+/// * Requires a `HashEngine` type in this module implementing `Default` and `crate::HashEngine<Hash = Hash, Bytes = [u8; $bits / 8]>`.
macro_rules! general_hash_type {
($bits:expr, $reverse:expr, $doc:literal) => {
/// Hashes some bytes.
diff --git a/hashes/tests/api.rs b/hashes/tests/api.rs
index afa3f9c2..be404c52 100644
--- a/hashes/tests/api.rs
+++ b/hashes/tests/api.rs
@@ -201,7 +201,7 @@ fn api_all_non_error_types_have_non_empty_debug() {
let t = Hashes::<Sha256>::new_sha256();
check_debug!(t; a, c, d, e, f, g, h, i, j, k, l);
- // This tests `Debug` on `Hkdf` but not for all `T: GeneralHash`.
+ // This tests `Debug` on `Hkdf` but not for all `HashEngine` types.
let t = Hkdf::<sha256::HashEngine>::new(&[], &[]);
let debug = format!("{:?}", t);
assert!(!debug.is_empty());
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.