File tree Expand file tree Collapse file tree 5 files changed +18
-6
lines changed Expand file tree Collapse file tree 5 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -327,7 +327,17 @@ pub mod windows {
327
327
if let Some ( proc) =
328
328
unsafe { GetProcAddress ( module, name. as_bytes_with_nul ( ) . as_ptr ( ) ) }
329
329
{
330
- Some ( unsafe { std:: mem:: transmute ( proc) } )
330
+ Some ( unsafe {
331
+ std:: mem:: transmute :: <
332
+ unsafe extern "system" fn ( ) -> isize ,
333
+ unsafe extern "system" fn (
334
+ * const u16 ,
335
+ FILE_INFO_BY_NAME_CLASS ,
336
+ * mut libc:: c_void ,
337
+ u32 ,
338
+ ) -> i32 ,
339
+ > ( proc)
340
+ } )
331
341
} else {
332
342
unsafe { FreeLibrary ( module) } ;
333
343
None
Original file line number Diff line number Diff line change @@ -379,7 +379,7 @@ mod _ssl {
379
379
#[ pyfunction( name = "RAND_add" ) ]
380
380
fn rand_add ( string : ArgStrOrBytesLike , entropy : f64 ) {
381
381
let f = |b : & [ u8 ] | {
382
- for buf in b. chunks ( libc:: c_int:: max_value ( ) as usize ) {
382
+ for buf in b. chunks ( libc:: c_int:: MAX as usize ) {
383
383
unsafe { sys:: RAND_add ( buf. as_ptr ( ) as * const _ , buf. len ( ) as _ , entropy) }
384
384
}
385
385
} ;
@@ -1513,7 +1513,7 @@ mod bio {
1513
1513
pub fn new ( buf : & ' a [ u8 ] ) -> Result < MemBioSlice < ' a > , ErrorStack > {
1514
1514
openssl:: init ( ) ;
1515
1515
1516
- assert ! ( buf. len( ) <= c_int:: max_value ( ) as usize ) ;
1516
+ assert ! ( buf. len( ) <= c_int:: MAX as usize ) ;
1517
1517
let bio = unsafe { sys:: BIO_new_mem_buf ( buf. as_ptr ( ) as * const _ , buf. len ( ) as c_int ) } ;
1518
1518
if bio. is_null ( ) {
1519
1519
return Err ( ErrorStack :: get ( ) ) ;
Original file line number Diff line number Diff line change @@ -236,7 +236,9 @@ impl std::fmt::Debug for PyMethodDef {
236
236
. field ( "name" , & self . name )
237
237
. field (
238
238
"func" ,
239
- & ( unsafe { std:: mem:: transmute :: < _ , [ usize ; 2 ] > ( self . func ) [ 1 ] as * const u8 } ) ,
239
+ & ( unsafe {
240
+ std:: mem:: transmute :: < & dyn PyNativeFn , [ usize ; 2 ] > ( self . func ) [ 1 ] as * const u8
241
+ } ) ,
240
242
)
241
243
. field ( "flags" , & self . flags )
242
244
. field ( "doc" , & self . doc )
Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ impl MaybeInternedString for Py<PyStr> {
286
286
#[ inline( always) ]
287
287
fn as_interned ( & self ) -> Option < & ' static PyStrInterned > {
288
288
if self . as_object ( ) . is_interned ( ) {
289
- Some ( unsafe { std:: mem:: transmute ( self ) } )
289
+ Some ( unsafe { std:: mem:: transmute :: < & Py < PyStr > , & PyInterned < PyStr > > ( self ) } )
290
290
} else {
291
291
None
292
292
}
Original file line number Diff line number Diff line change @@ -999,7 +999,7 @@ pub(super) mod _os {
999
999
-1
1000
1000
} else {
1001
1001
distance_to_move[ 0 ] = ret as _ ;
1002
- std:: mem:: transmute ( distance_to_move)
1002
+ std:: mem:: transmute :: < [ i32 ; 2 ] , i64 > ( distance_to_move)
1003
1003
}
1004
1004
} ;
1005
1005
if res < 0 {
You can’t perform that action at this time.
0 commit comments