Skip to content

Commit 52a989f

Browse files
authored
aead: test fixups (#1881)
- ~~There's no reason for these tests to be gated on `alloc`~~ (aah, we need it, but can go finer-grained) - Fixes comment on object safety / dyn compatibility test for `Aead` - Adds dyn compatibility test for `AeadInOut`
1 parent baf8d73 commit 52a989f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

aead/src/lib.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,12 +431,16 @@ impl<const N: usize> Buffer for heapless::Vec<u8, N> {
431431
}
432432
}
433433

434-
#[cfg(feature = "alloc")]
435434
#[cfg(test)]
436435
mod tests {
437436
use super::*;
438437

439-
/// Ensure that `AeadInPlace` is object-safe
438+
/// Ensure that `Aead` is `dyn`-compatible
439+
#[cfg(feature = "alloc")]
440+
#[allow(dead_code)]
441+
type DynAead<N, T> = dyn Aead<NonceSize = N, TagSize = T>;
442+
443+
/// Ensure that `AeadInOut` is `dyn`-compatible
440444
#[allow(dead_code)]
441-
type DynAeadInPlace<N, T> = dyn Aead<NonceSize = N, TagSize = T>;
445+
type DynAeadInOut<N, T> = dyn AeadInOut<NonceSize = N, TagSize = T>;
442446
}

0 commit comments

Comments
 (0)