File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -78,9 +78,9 @@ macro_rules! register_custom_getrandom {
7878 ( $path: path) => {
7979 // TODO(MSRV 1.37): change to unnamed block
8080 const __getrandom_internal: ( ) = {
81- // We use an extern "C" function to get the guarantees of a stable ABI .
81+ // We use Rust ABI to be safe against potential panics in the passed function .
8282 #[ no_mangle]
83- unsafe extern "C" fn __getrandom_custom( dest: * mut u8 , len: usize ) -> u32 {
83+ unsafe fn __getrandom_custom( dest: * mut u8 , len: usize ) -> u32 {
8484 // Make sure the passed function has the type of getrandom::getrandom
8585 type F = fn ( & mut [ u8 ] ) -> :: core:: result:: Result <( ) , $crate:: Error >;
8686 let _: F = $crate:: getrandom;
@@ -97,7 +97,7 @@ macro_rules! register_custom_getrandom {
9797
9898#[ allow( dead_code) ]
9999pub fn getrandom_inner ( dest : & mut [ MaybeUninit < u8 > ] ) -> Result < ( ) , Error > {
100- extern "C " {
100+ extern "Rust " {
101101 fn __getrandom_custom ( dest : * mut u8 , len : usize ) -> u32 ;
102102 }
103103 // Previously we always passed a valid, initialized slice to
You can’t perform that action at this time.
0 commit comments