Closed
Description
use std::time::{Duration, UNIX_EPOCH};
use std::u64;
fn main() {
let t = UNIX_EPOCH + Duration::new(u64::MAX, 0) + Duration::new(2, 0);
println!("{}", t.duration_since(UNIX_EPOCH).unwrap().as_secs()); // 1
}
For me (Linux + Rust 1.19.0-nightly) this program prints 1. In debug mode I would expect this overflow to be caught and panic, similar to u64::MAX + 2
.