Skip to content

Commit a1ddafb

Browse files
committed
Allow rdrand tests to work with new implementation
Signed-off-by: Joe Richey <joerichey@google.com>
1 parent dfc0d1c commit a1ddafb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/rdrand.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,10 @@ mod rdrand;
1111
#[path = "../src/util.rs"]
1212
mod util;
1313

14-
use rdrand::getrandom_inner as getrandom_impl;
14+
// The rdrand implementation has the signature of getrandom_uninit(), but our
15+
// tests expect getrandom_impl() to have the signature of getrandom().
16+
fn getrandom_impl(dest: &mut [u8]) -> Result<(), Error> {
17+
rdrand::getrandom_inner(unsafe { util::slice_as_uninit_mut(dest) })?;
18+
Ok(())
19+
}
1520
mod common;

0 commit comments

Comments
 (0)