Rollup merge of #76388 - poliorcetics:system-time-document-panic, r=KodrAus
Add a note about the panic behavior of math operations on time objects Fixes #71226.
This commit is contained in:
commit
59476e9e57
1 changed files with 10 additions and 0 deletions
|
@ -100,6 +100,11 @@ pub use core::time::Duration;
|
||||||
/// [clock_time_get (Monotonic Clock)]: https://nuxi.nl/cloudabi/#clock_time_get
|
/// [clock_time_get (Monotonic Clock)]: https://nuxi.nl/cloudabi/#clock_time_get
|
||||||
///
|
///
|
||||||
/// **Disclaimer:** These system calls might change over time.
|
/// **Disclaimer:** These system calls might change over time.
|
||||||
|
///
|
||||||
|
/// > Note: mathematical operations like [`add`] may panic if the underlying
|
||||||
|
/// > structure cannot represent the new point in time.
|
||||||
|
///
|
||||||
|
/// [`add`]: Instant::add
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
#[stable(feature = "time2", since = "1.8.0")]
|
#[stable(feature = "time2", since = "1.8.0")]
|
||||||
pub struct Instant(time::Instant);
|
pub struct Instant(time::Instant);
|
||||||
|
@ -174,6 +179,11 @@ pub struct Instant(time::Instant);
|
||||||
/// [GetSystemTimeAsFileTime]: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime
|
/// [GetSystemTimeAsFileTime]: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime
|
||||||
///
|
///
|
||||||
/// **Disclaimer:** These system calls might change over time.
|
/// **Disclaimer:** These system calls might change over time.
|
||||||
|
///
|
||||||
|
/// > Note: mathematical operations like [`add`] may panic if the underlying
|
||||||
|
/// > structure cannot represent the new point in time.
|
||||||
|
///
|
||||||
|
/// [`add`]: SystemTime::add
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
#[stable(feature = "time2", since = "1.8.0")]
|
#[stable(feature = "time2", since = "1.8.0")]
|
||||||
pub struct SystemTime(time::SystemTime);
|
pub struct SystemTime(time::SystemTime);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue