@@ -998,21 +998,25 @@ mod decl {
998998 }
999999
10001000 #[ cfg( any( unix, windows) ) ]
1001+ #[ cfg_attr( target_env = "musl" , allow( deprecated) ) ]
10011002 fn pyobj_to_time_t ( value : Either < f64 , i64 > , vm : & VirtualMachine ) -> PyResult < libc:: time_t > {
10021003 match value {
10031004 Either :: A ( float) => {
10041005 if !float. is_finite ( ) {
10051006 return Err ( vm. new_value_error ( "Invalid value for timestamp" ) ) ;
10061007 }
10071008 let secs = float. floor ( ) ;
1009+ #[ cfg_attr( target_env = "musl" , allow( deprecated) ) ]
10081010 if secs < libc:: time_t:: MIN as f64 || secs > libc:: time_t:: MAX as f64 {
10091011 return Err ( vm. new_overflow_error ( "timestamp out of range for platform time_t" ) ) ;
10101012 }
1013+ #[ cfg_attr( target_env = "musl" , allow( deprecated) ) ]
10111014 Ok ( secs as libc:: time_t )
10121015 }
10131016 Either :: B ( int) => {
10141017 // try_into is needed on 32-bit platforms where time_t != i64
10151018 #[ allow( clippy:: useless_conversion) ]
1019+ #[ cfg_attr( target_env = "musl" , allow( deprecated) ) ]
10161020 let ts: libc:: time_t = int. try_into ( ) . map_err ( |_| {
10171021 vm. new_overflow_error ( "timestamp out of range for platform time_t" )
10181022 } ) ?;
@@ -1052,6 +1056,7 @@ mod platform {
10521056 convert:: IntoPyException ,
10531057 } ;
10541058 use core:: time:: Duration ;
1059+ #[ cfg_attr( target_env = "musl" , allow( deprecated) ) ]
10551060 use libc:: time_t;
10561061 use nix:: { sys:: time:: TimeSpec , time:: ClockId } ;
10571062
@@ -1116,10 +1121,12 @@ mod platform {
11161121 }
11171122 }
11181123
1124+ #[ cfg_attr( target_env = "musl" , allow( deprecated) ) ]
11191125 pub ( super ) fn current_time_t ( ) -> time_t {
11201126 unsafe { libc:: time ( core:: ptr:: null_mut ( ) ) }
11211127 }
11221128
1129+ #[ cfg_attr( target_env = "musl" , allow( deprecated) ) ]
11231130 pub ( super ) fn gmtime_from_timestamp (
11241131 when : time_t ,
11251132 vm : & VirtualMachine ,
@@ -1132,6 +1139,7 @@ mod platform {
11321139 Ok ( struct_time_from_tm ( vm, unsafe { out. assume_init ( ) } ) )
11331140 }
11341141
1142+ #[ cfg_attr( target_env = "musl" , allow( deprecated) ) ]
11351143 pub ( super ) fn localtime_from_timestamp (
11361144 when : time_t ,
11371145 vm : & VirtualMachine ,
@@ -1200,6 +1208,7 @@ mod platform {
12001208
12011209 #[ cfg( not( target_os = "redox" ) ) ]
12021210 #[ cfg( any( not( target_vendor = "apple" ) , target_os = "macos" ) ) ]
1211+ #[ cfg_attr( target_env = "musl" , allow( deprecated) ) ]
12031212 #[ pyfunction]
12041213 fn clock_settime_ns ( clk_id : ClockId , time : libc:: time_t , vm : & VirtualMachine ) -> PyResult < ( ) > {
12051214 let ts = Duration :: from_nanos ( time as _ ) . into ( ) ;
@@ -1369,10 +1378,12 @@ mod platform {
13691378 }
13701379 }
13711380
1381+ #[ cfg_attr( target_env = "musl" , allow( deprecated) ) ]
13721382 pub ( super ) fn current_time_t ( ) -> libc:: time_t {
13731383 unsafe { libc:: time ( core:: ptr:: null_mut ( ) ) }
13741384 }
13751385
1386+ #[ cfg_attr( target_env = "musl" , allow( deprecated) ) ]
13761387 pub ( super ) fn gmtime_from_timestamp (
13771388 when : libc:: time_t ,
13781389 vm : & VirtualMachine ,
@@ -1390,6 +1401,7 @@ mod platform {
13901401 ) )
13911402 }
13921403
1404+ #[ cfg_attr( target_env = "musl" , allow( deprecated) ) ]
13931405 pub ( super ) fn localtime_from_timestamp (
13941406 when : libc:: time_t ,
13951407 vm : & VirtualMachine ,
0 commit comments