Skip to content

Commit

Permalink
Remove test of static Context
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
dtolnay committed Jan 2, 2023
1 parent fd59b62 commit 257e766
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions library/core/tests/task.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use core::task::{Context, Poll, RawWaker, RawWakerVTable, Waker};
use core::task::{Poll, RawWaker, RawWakerVTable, Waker};

#[test]
fn poll_const() {
Expand All @@ -21,9 +21,5 @@ fn waker_const() {

static WAKER: Waker = unsafe { Waker::from_raw(VOID_WAKER) };

static CONTEXT: Context<'static> = Context::from_waker(&WAKER);

static WAKER_REF: &'static Waker = CONTEXT.waker();

WAKER_REF.wake_by_ref();
WAKER.wake_by_ref();
}

0 comments on commit 257e766

Please sign in to comment.