Skip to content

Commit 5530d29

Browse files
committed
Simplify cast using as_mut_ptr()
1 parent 808b149 commit 5530d29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/compile-fail/getrandom.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ extern crate libc;
44
fn main() {
55
let mut buf = [0u8; 5];
66
unsafe {
7-
libc::syscall(libc::SYS_getrandom, &mut buf as &mut [u8] as *mut [u8] as *mut u8 as *mut libc::c_void, 5, 0);
7+
libc::syscall(libc::SYS_getrandom, buf.as_mut_ptr() as *mut libc::c_void, 5, 0);
88
//~^ ERROR constant evaluation error: miri does not support random number generators in deterministic mode!
99
}
1010
}

0 commit comments

Comments
 (0)