What changed, and why it matters
This commit only adds a new automated test that checks two existing error types implement Rust's standard Error trait. It does not change any production code, fix any bug, or alter behavior. There is no security relevance.
No action required; this is a test-only addition with no security implications.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds a single test function all_error_types_implement_error in hashes/tests/api.rs, gated by the std feature. It uses a generic helper assert_error<T: std::error::Error>() to assert at compile time that hkdf::MaxLengthError and sha256::MidstateError implement std::error::Error. No library code is modified.
Changed components
hashes/tests/api.rsInspect captured patch +10 / −0
diff --git a/hashes/tests/api.rs b/hashes/tests/api.rs
index ca5c91c4..2f9ae383 100644
--- a/hashes/tests/api.rs
+++ b/hashes/tests/api.rs
@@ -229,3 +229,13 @@ fn all_types_implement_send_sync() {
assert_send::<Errors>();
assert_sync::<Errors>();
}
+
+// Error types should implement `std::error::Error` (C-GOOD-ERR).
+#[cfg(feature = "std")]
+#[test]
+fn all_error_types_implement_error() {
+ fn assert_error<T: std::error::Error>() {}
+
+ assert_error::<hkdf::MaxLengthError>();
+ assert_error::<sha256::MidstateError>();
+}
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.