We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7560265 commit 83d14bdCopy full SHA for 83d14bd
src/libstd/time/mod.rs
@@ -520,9 +520,12 @@ mod tests {
520
521
assert_almost_eq!(a - second + second, a);
522
523
- let eighty_years = second * 60 * 60 * 24 * 365 * 80;
524
- assert_almost_eq!(a - eighty_years + eighty_years, a);
525
- assert_almost_eq!(a - (eighty_years * 10) + (eighty_years * 10), a);
+ // A difference of 80 and 800 years cannot fit inside a 32-bit time_t
+ if !(cfg!(unix) && ::mem::size_of::<::libc::time_t>() <= 4) {
+ let eighty_years = second * 60 * 60 * 24 * 365 * 80;
526
+ assert_almost_eq!(a - eighty_years + eighty_years, a);
527
+ assert_almost_eq!(a - (eighty_years * 10) + (eighty_years * 10), a);
528
+ }
529
530
let one_second_from_epoch = UNIX_EPOCH + Duration::new(1, 0);
531
let one_second_from_epoch2 = UNIX_EPOCH + Duration::new(0, 500_000_000)
0 commit comments