Open
Description
opened on Apr 2, 2024
Feature gate: #![feature(context_ext)]
This is a tracking issue for allowing std::task::Context
to carry arbitrary extension data.
Public API
impl Context {
fn ext(&mut self) -> &mut dyn Any;
}
impl ContextBuilder {
fn ext(self, data: &'a mut dyn Any) -> Self;
fn from(cx: &'a mut Context<'_>) -> Self;
fn waker(self, waker: &'a Waker) -> Self;
}
Steps / History
- Implementation: Add
Context::ext
#123203 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- passing refs maybe unsound
- too complex
- This causes Context to no longer be UnwindSafe, which may be a breaking change: regression: the type
(dyn Any + 'static)
may contain interior mutability #125193 (the issue is closed but there still is a FIXME in the code)
Footnotes
Metadata
Assignees
Labels
Area: Async & AwaitAsync-await issues that have been triaged during a working group meeting.Category: An issue tracking the progress of sth. like the implementation of an RFC`#![feature(context_ext)]`Relevant to the library API team, which will review and decide on the PR/issue.Working group: Async & await
Activity