Skip to content

Commit 261773e

Browse files
authored
Rollup merge of #75371 - poliorcetics:intra-doc-links-std-time, r=jyn514
Move to doc links inside std/time.rs Helps with #75080. @rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc
2 parents c423fde + bd01bf9 commit 261773e

File tree

1 file changed

+5
-28
lines changed

1 file changed

+5
-28
lines changed

library/std/src/time.rs

+5-28
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ pub use core::time::Duration;
9797
/// [clock_time_get (Monotonic Clock)]: https://nuxi.nl/cloudabi/#clock_time_get
9898
///
9999
/// **Disclaimer:** These system calls might change over time.
100-
///
101100
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
102101
#[stable(feature = "time2", since = "1.8.0")]
103102
pub struct Instant(time::Instant);
@@ -125,11 +124,6 @@ pub struct Instant(time::Instant);
125124
/// The size of a `SystemTime` struct may vary depending on the target operating
126125
/// system.
127126
///
128-
/// [`Instant`]: ../../std/time/struct.Instant.html
129-
/// [`Result`]: ../../std/result/enum.Result.html
130-
/// [`Duration`]: ../../std/time/struct.Duration.html
131-
/// [`UNIX_EPOCH`]: ../../std/time/constant.UNIX_EPOCH.html
132-
///
133127
/// Example:
134128
///
135129
/// ```no_run
@@ -176,7 +170,6 @@ pub struct Instant(time::Instant);
176170
/// [GetSystemTimeAsFileTime]: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime
177171
///
178172
/// **Disclaimer:** These system calls might change over time.
179-
///
180173
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
181174
#[stable(feature = "time2", since = "1.8.0")]
182175
pub struct SystemTime(time::SystemTime);
@@ -368,7 +361,7 @@ impl Add<Duration> for Instant {
368361
/// This function may panic if the resulting point in time cannot be represented by the
369362
/// underlying data structure. See [`checked_add`] for a version without panic.
370363
///
371-
/// [`checked_add`]: ../../std/time/struct.Instant.html#method.checked_add
364+
/// [`checked_add`]: Instant::checked_add
372365
fn add(self, other: Duration) -> Instant {
373366
self.checked_add(other).expect("overflow when adding duration to instant")
374367
}
@@ -463,11 +456,6 @@ impl SystemTime {
463456
/// Returns an [`Err`] if `earlier` is later than `self`, and the error
464457
/// contains how far from `self` the time is.
465458
///
466-
/// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
467-
/// [`Duration`]: ../../std/time/struct.Duration.html
468-
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
469-
/// [`Instant`]: ../../std/time/struct.Instant.html
470-
///
471459
/// # Examples
472460
///
473461
/// ```
@@ -497,11 +485,6 @@ impl SystemTime {
497485
/// Returns an [`Err`] if `self` is later than the current system time, and
498486
/// the error contains how far from the current system time `self` is.
499487
///
500-
/// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
501-
/// [`Duration`]: ../../std/time/struct.Duration.html
502-
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
503-
/// [`Instant`]: ../../std/time/struct.Instant.html
504-
///
505488
/// # Examples
506489
///
507490
/// ```no_run
@@ -544,7 +527,7 @@ impl Add<Duration> for SystemTime {
544527
/// This function may panic if the resulting point in time cannot be represented by the
545528
/// underlying data structure. See [`checked_add`] for a version without panic.
546529
///
547-
/// [`checked_add`]: ../../std/time/struct.SystemTime.html#method.checked_add
530+
/// [`checked_add`]: SystemTime::checked_add
548531
fn add(self, dur: Duration) -> SystemTime {
549532
self.checked_add(dur).expect("overflow when adding duration to instant")
550533
}
@@ -589,8 +572,6 @@ impl fmt::Debug for SystemTime {
589572
/// measurement lies, and using `UNIX_EPOCH + duration` can be used to create a
590573
/// [`SystemTime`] instance to represent another fixed point in time.
591574
///
592-
/// [`SystemTime`]: ../../std/time/struct.SystemTime.html
593-
///
594575
/// # Examples
595576
///
596577
/// ```no_run
@@ -608,13 +589,9 @@ impl SystemTimeError {
608589
/// Returns the positive duration which represents how far forward the
609590
/// second system time was from the first.
610591
///
611-
/// A `SystemTimeError` is returned from the [`duration_since`] and [`elapsed`]
612-
/// methods of [`SystemTime`] whenever the second system time represents a point later
613-
/// in time than the `self` of the method call.
614-
///
615-
/// [`duration_since`]: ../../std/time/struct.SystemTime.html#method.duration_since
616-
/// [`elapsed`]: ../../std/time/struct.SystemTime.html#method.elapsed
617-
/// [`SystemTime`]: ../../std/time/struct.SystemTime.html
592+
/// A `SystemTimeError` is returned from the [`SystemTime::duration_since`]
593+
/// and [`SystemTime::elapsed`] methods whenever the second system time
594+
/// represents a point later in time than the `self` of the method call.
618595
///
619596
/// # Examples
620597
///

0 commit comments

Comments
 (0)