Skip to content

no method named _ found for reference &Waker in the current scope #3450

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

Closed
rowanfr opened this issue Oct 23, 2024 · 2 comments
Closed

no method named _ found for reference &Waker in the current scope #3450

rowanfr opened this issue Oct 23, 2024 · 2 comments

Comments

@rowanfr
Copy link

rowanfr commented Oct 23, 2024

When trying to compile using dependency embassy-executor = { version = "0.6.1", features = ["nightly", "integrated-timers"] } on the esp toolchain installed by espup I get compiler error:

error[E0599]: no method named `vtable` found for reference `&Waker` in the current scope
  --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embassy-executor-0.6.1/src/raw/waker.rs:53:20
   |
53 |             (waker.vtable(), waker.data())
   |                    ^^^^^^ method not found in `&Waker`

error[E0599]: no method named `data` found for reference `&Waker` in the current scope
  --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embassy-executor-0.6.1/src/raw/waker.rs:53:36
   |
53 |             (waker.vtable(), waker.data())
   |                                    ^^^^ method not found in `&Waker`

This is due to my toolchain being esp which is considered nightly and the current accessors not being available for type Waker. The relevant code snippets are:

#[cfg(feature = "nightly")]
{
(waker.vtable(), waker.data())
}

pub struct Waker {
    waker: RawWaker,
}
pub struct RawWaker {
    /// A data pointer, which can be used to store arbitrary data as required
    /// by the executor. This could be e.g. a type-erased pointer to an `Arc`
    /// that is associated with the task.
    /// The value of this field gets passed to all functions that are part of
    /// the vtable as the first parameter.
    data: *const (),
    /// Virtual function pointer table that customizes the behavior of this waker.
    vtable: &'static RawWakerVTable,
}

I presume that this section in the executor should be altered to use RawWaker but there is a chance that the esp toolchain is at fault and nothing needs to be done in this code base. I will look further into this but I'm not familiar with Waker.

@decaday
Copy link
Contributor

decaday commented Oct 27, 2024

This is because of the nightly API changes.
waker_getters have been stabilized for 1.83. See rust-lang/rust#96992.

01d8508

@rowanfr
Copy link
Author

rowanfr commented Oct 28, 2024

Closing the issue as @decaday correctly pointed out the API change and thus this has nothing to do with embassy

@rowanfr rowanfr closed this as completed Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants