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 {
358
358
359
359
/// Helper function used to create an instant in the future
360
360
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 ;
362
364
ts. tv_nsec += SECOND / 10 ;
363
365
// 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 ;
365
367
ts. tv_nsec %= SECOND ;
366
368
ts
367
369
}
@@ -427,4 +429,3 @@ mod test_clock_nanosleep {
427
429
assert ! ( start_test_sleep. elapsed( ) > Duration :: from_millis( 100 ) ) ;
428
430
}
429
431
}
430
-
You can’t perform that action at this time.
0 commit comments