diff --git a/library/std/src/sys/unix/time.rs b/library/std/src/sys/unix/time.rs index 2d0a90eca4c5..66501061b4c9 100644 --- a/library/std/src/sys/unix/time.rs +++ b/library/std/src/sys/unix/time.rs @@ -77,7 +77,7 @@ impl Timespec { if tv_nsec >= 0 && tv_nsec < NSEC_PER_SEC as i64 { Ok(unsafe { Self::new_unchecked(tv_sec, tv_nsec) }) } else { - Err(io::const_io_error!(io::ErrorKind::Other, "Invalid time for nanosecond")) + Err(io::const_io_error!(io::ErrorKind::InvalidData, "Invalid timestamp")) } }