Closed oxalica closed 2 months ago
This will be merged soon.
It looks like there was a vote to merge, but this issue isn't a PR and it remains open. What's next here?
As I have already mentioned, this feature is not really usable with alloc::task::Wake
.
Could it be possible to add the following implementation?
impl<W: Wake + Send + Sync + 'static> Arc<W> {
const fn waker_vtable() -> &'static RawWakerVTable { ... }
}
It would allow to match the vtable returned by RawWaker::vtable
.
this feature is not really usable with
alloc::task::Wake
.
Does Waker::from(&arc_wake).as_raw().vtable()
not work?
Does Waker::from(&arc_wake).as_raw().vtable() not work?
Yes it works, but it requires to already have an allocated arc_wake
, which makes the thing unusable.
The goal is to compare the vtable of a random waker to know if I can cast its data pointer to my own waker implementation. I don't want to rely for this comparison on a lazily allocated waker to get its vtable (especially as this lazy waker may requires some parameters random to be initialized). In short, this is unusable.
That's too bad, because Wake
is a convenient implementation shortcut, but I have to rewrite it myself to use this feature.
If I understand correctly, the FCP has happened and ended with a disposition to merge. Is there some reason why the FCP checkbox in the first comment is still unticked? In terms of the stabilization PR, is that just waiting for someone to do it, or is there some missing prerequisite?
This is just waiting for someone to submit a stabilization PR.
Submitted a stabilization PR: https://github.com/rust-lang/rust/pull/129919
Feature gate:
#![feature(waker_getters)]
This is a tracking issue for getters of data and vtable pointers for
RawWaker
, and the method to getRawWaker
fromWaker
.Public API
Steps / History
Unresolved Questions
fn into_raw(self) -> RawWaker
forWaker
? https://github.com/rust-lang/rust/issues/87021#issuecomment-1091899591