Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
time: eliminate panics from
Instant
arithmetic (tokio-rs#4461)
`Instant::duration_since`, `Instant::elapsed`, and `Instant::sub` may panic. This is especially dangerous when `Instant::now` travels back in time. While this isn't supposed to happen, this behavior is highly platform-dependent (e.g., rust-lang/rust#86470). This change modifies the behavior of `tokio::time::Instant` to prevent this class of panic, as proposed for `std::time::Instant` in rust-lang/rust#89926.
- Loading branch information