@@ -319,26 +319,29 @@ mod imp {
319319 ) ) ]
320320 unsafe fn get_stack_start ( ) -> Option < * mut libc:: c_void > {
321321 let mut ret = None ;
322- let attr: mem:: MaybeUninit < libc:: pthread_attr_t > = if cfg ! ( target_os = "freebsd" ) {
322+ let mut attr: mem:: MaybeUninit < libc:: pthread_attr_t > = if cfg ! ( target_os = "freebsd" ) {
323323 let mut attr = mem:: MaybeUninit :: uninit ( ) ;
324324 assert_eq ! ( libc:: pthread_attr_init( ( & raw mut attr) as * mut _) , 0 ) ;
325325 attr
326326 } else {
327327 mem:: MaybeUninit :: zeroed ( )
328328 } ;
329- let mut attr = unsafe { attr . assume_init ( ) } ;
329+
330330 #[ cfg( target_os = "freebsd" ) ]
331- let e = libc:: pthread_attr_get_np ( libc:: pthread_self ( ) , & mut attr) ;
331+ let e = libc:: pthread_attr_get_np ( libc:: pthread_self ( ) , attr. as_mut_ptr ( ) ) ;
332332 #[ cfg( not( target_os = "freebsd" ) ) ]
333- let e = libc:: pthread_getattr_np ( libc:: pthread_self ( ) , & mut attr) ;
333+ let e = libc:: pthread_getattr_np ( libc:: pthread_self ( ) , attr. as_mut_ptr ( ) ) ;
334334 if e == 0 {
335335 let mut stackaddr = crate :: ptr:: null_mut ( ) ;
336336 let mut stacksize = 0 ;
337- assert_eq ! ( libc:: pthread_attr_getstack( & attr, & mut stackaddr, & mut stacksize) , 0 ) ;
337+ assert_eq ! (
338+ libc:: pthread_attr_getstack( attr. as_ptr( ) , & mut stackaddr, & mut stacksize) ,
339+ 0
340+ ) ;
338341 ret = Some ( stackaddr) ;
339342 }
340343 if e == 0 || cfg ! ( target_os = "freebsd" ) {
341- assert_eq ! ( libc:: pthread_attr_destroy( & mut attr) , 0 ) ;
344+ assert_eq ! ( libc:: pthread_attr_destroy( attr. as_mut_ptr ( ) ) , 0 ) ;
342345 }
343346 ret
344347 }
0 commit comments