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

rt: fix accidental unsetting of current handle #5178

Merged
merged 2 commits into from Nov 9, 2022

Commits on Nov 9, 2022

  1. rt: fix accidental unsetting of current handle

    An earlier change updated `enter_runtime` to also set the current
    handle. However, the change did not store the `SetCurrentGuard`, so the
    "current handle" was immediately unset. This patch stores the the
    `SetCurrentGuard` in the `EnterRuntimeGuard`.
    
    No existing test exposed this bug because all tests went via `Runtime`
    instead of `Handle`. Currently, `Runtime` is still explicitly setting
    the handle before entering runtime, so all tests still passed. A new
    test is added that covers the case of calling `Handle::block_on` and
    accessing the current handle.
    carllerche committed Nov 9, 2022
    Copy the full SHA
    80616d0 View commit details
    Browse the repository at this point in the history
  2. make clippy happy

    carllerche committed Nov 9, 2022
    Copy the full SHA
    8dfbb95 View commit details
    Browse the repository at this point in the history