Skip to content

Commit 8278380

Browse files
Update to reflect feedback on the constraints
1 parent a80dbea commit 8278380

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

library/core/src/time.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,10 @@ impl Duration {
136136

137137
/// The maximum duration.
138138
///
139-
/// May vary by platform. At least equal to the number of seconds
140-
/// difference between the minimum and maximum [`std::time::Instant`].
141-
/// On many platforms this is roughly 584,942,417,355 years.
139+
/// May vary by platform as necessary. Must be able to contain the difference between
140+
/// two instances of [`Instant`] or two instances of [`SystemTime`].
141+
/// This constraint gives it a value of about 584,942,417,355 years in practice,
142+
/// which is currently used on all platforms.
142143
///
143144
/// # Examples
144145
///
@@ -147,7 +148,8 @@ impl Duration {
147148
///
148149
/// assert_eq!(Duration::MAX, Duration::new(u64::MAX, 1_000_000_000 - 1));
149150
/// ```
150-
/// [`std::time::Instant`]: ../../std/time/struct.Instant.html
151+
/// [`Instant`]: ../../std/time/struct.Instant.html
152+
/// [`SystemTime`]: ../../std/time/struct.SystemTime.html
151153
#[stable(feature = "duration_saturating_ops", since = "1.53.0")]
152154
pub const MAX: Duration = Duration::new(u64::MAX, NANOS_PER_SEC - 1);
153155

0 commit comments

Comments
 (0)