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

Add PhantomData marker to Context to make Context !Send and !Sync #95985

Merged
merged 2 commits into from
Jan 3, 2023

Commits on Jan 2, 2023

  1. Configuration menu
    Copy the full SHA
    fd59b62 View commit details
    Browse the repository at this point in the history
  2. Remove test of static Context

    Context is no longer Sync so this doesn't work.
    
        error[E0277]: `*mut ()` cannot be shared between threads safely
          --> library/core/tests/task.rs:24:21
           |
        24 |     static CONTEXT: Context<'static> = Context::from_waker(&WAKER);
           |                     ^^^^^^^^^^^^^^^^ `*mut ()` cannot be shared between threads safely
           |
           = help: within `Context<'static>`, the trait `Sync` is not implemented for `*mut ()`
           = note: required because it appears within the type `PhantomData<*mut ()>`
           = note: required because it appears within the type `Context<'static>`
           = note: shared static variables must have a type that implements `Sync`
    dtolnay committed Jan 2, 2023
    Configuration menu
    Copy the full SHA
    257e766 View commit details
    Browse the repository at this point in the history