File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/tools/miri/tests/pass-dep/libc Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -358,10 +358,12 @@ mod test_clock_nanosleep {
358358
359359 /// Helper function used to create an instant in the future
360360 fn add_100_millis ( mut ts : libc:: timespec ) -> libc:: timespec {
361- const SECOND : i64 = 1_000_000_000 ;
361+ // While tv_nsec has type `c_long` tv_sec has type `time_t`. These might
362+ // end up as different types (for example: like i32 and i64).
363+ const SECOND : libc:: c_long = 1_000_000_000 ;
362364 ts. tv_nsec += SECOND / 10 ;
363365 // If this pushes tv_nsec to SECOND or higher, we need to overflow to tv_sec.
364- ts. tv_sec += ts. tv_nsec / SECOND ;
366+ ts. tv_sec += ( ts. tv_nsec / SECOND ) as libc :: time_t ;
365367 ts. tv_nsec %= SECOND ;
366368 ts
367369 }
@@ -427,4 +429,3 @@ mod test_clock_nanosleep {
427429 assert ! ( start_test_sleep. elapsed( ) > Duration :: from_millis( 100 ) ) ;
428430 }
429431}
430-
You can’t perform that action at this time.
0 commit comments