File tree 1 file changed +3
-3
lines changed
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 {
78
78
( $path: path) => {
79
79
// TODO(MSRV 1.37): change to unnamed block
80
80
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 .
82
82
#[ 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 {
84
84
// Make sure the passed function has the type of getrandom::getrandom
85
85
type F = fn ( & mut [ u8 ] ) -> :: core:: result:: Result <( ) , $crate:: Error >;
86
86
let _: F = $crate:: getrandom;
@@ -97,7 +97,7 @@ macro_rules! register_custom_getrandom {
97
97
98
98
#[ allow( dead_code) ]
99
99
pub fn getrandom_inner ( dest : & mut [ MaybeUninit < u8 > ] ) -> Result < ( ) , Error > {
100
- extern "C " {
100
+ extern "Rust " {
101
101
fn __getrandom_custom ( dest : * mut u8 , len : usize ) -> u32 ;
102
102
}
103
103
// Previously we always passed a valid, initialized slice to
You can’t perform that action at this time.
0 commit comments