Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time: Eliminate panics from Instant arithmetic #4461

Merged
merged 1 commit into from
Feb 6, 2022

Commits on Feb 1, 2022

  1. time: Eliminate panics from Instant arithmetic

    `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.
    olix0r committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    825db55 View commit details
    Browse the repository at this point in the history