--- title: WG-async triage meeting 2024-04-08 tags: ["WG-async", "triage-meeting", "minutes"] date: 2024-04-08 discussion: https://rust-lang.zulipchat.com/#narrow/stream/187312-wg-async/topic/Triage.20meeting.202024-04-08 url: https://hackmd.io/xlZGjBqXS6iqQ7qHpccm1w --- # WG-async meeting agenda - Meeting date: 2024-04-08 ## Attendance - People: TC, Yosh, Daria ## Meeting roles - Minutes: TC ## Scheduled meetings None. Update these [here](https://github.com/orgs/rust-lang/projects/40/views/1). ## Proposed meetings None. Update these [here](https://github.com/orgs/rust-lang/projects/40/views/1). ## Announcements or custom items (Meeting attendees, feel free to add items here!) ## Untriaged issues ### "Recursive async functions don't internally implement auto traits" rust#123072 **Link:** https://github.com/rust-lang/rust/issues/123072 We left a comment. ### "Async closures are not allowed to reference all captured lifetimes if one of them is invariant" rust#123241 **Link:** https://github.com/rust-lang/rust/issues/123241 We left a comment. ### "Incorrect line table generation for await points" rust#123341 **Link:** https://github.com/rust-lang/rust/issues/123341 We left a comment. ### "Add LocalWaker support" libs-team#191 **Link:** https://github.com/rust-lang/libs-team/issues/191 We left a comment and unnominated this. There's a checkbox on the tracking issue for checking that WG-async is OK with the design prior to stabilization. ### "Context reactor hook" libs-team#347 **Link:** https://github.com/rust-lang/libs-team/issues/347 Yosh: I feel like this design wouldn't work for the executor I'm writing. Or if it would, it would not be ergonomic. I should sit down with Justin and dig into this. Then we would know for sure, and maybe some small change would address this. TC: Let's leave this nominated, as there does seem more for us to discuss here. Daria: Seems to be incompatible with [wasm-bindgen-futures](https://crates.io/crates/wasm-bindgen-futures) Yosh: yes, that makes sense. ## Discussion about `AsyncIterator` (Various discussion.) TC: So we'd have `async gen` blocks return an opaque type that implements `IntoAsyncGen`... TC/Yosh: ```rust trait AsyncGen: Future<Output = Option<Self::Item>> { type Item; } trait IntoAsyncGen { type Item; type IntoAsyncGen: AsyncGen<Item = Self::Item>; fn into_async_gen(self) -> Self::IntoAsyncGen; } struct Foo; impl IntoAsyncGen for Pin<&mut Foo> { async gen fn into_async_gen(self) -> _ { todo!() } } //trait AsyncIterator { async fn next(); } async fn main() { let x: impl IntoAsyncGen = async gen {}; } ``` TC: Object safety: ```rust trait AsyncIterator { type Item; async fn next(&mut self) -> Self::Item; } ``` TC/Yosh: ```rust // AFIT, state is split between self and `next` trait AsyncIterator { type Item; type Next<'a>: Future<Output = Self::Item> where Self: 'a; fn next(&mut self) -> Self:Next<'_>; } // sync, state is split between self and `next` trait Iterator { fn next(&mut self) { ... /* local state */ } } // all state lives in self trait AsyncIterator { type Item; fn poll_next(self: Pin<..>) -> Poll<...> {} } ``` ```rust trait AsyncGen: Future<Output = Option<Self::Thing>> { .. } ``` ```rust coro fn handler(mut x: Input) yields Output { loop { x = yield do_something_with_input(x); } } ``` (The meeting ended here.) ## Nominated RFCs, PRs, and issues ### "Tracking Issue for `waker_getters`" rust#96992 **Link:** https://github.com/rust-lang/rust/issues/96992 ### "Tracking Issue for `task::Waker::noop`" rust#98286 **Link:** https://github.com/rust-lang/rust/issues/98286 ### "Tracking Issue for `Ready::into_inner()`" rust#101196 **Link:** https://github.com/rust-lang/rust/issues/101196 ### "Tracking Issue for `const_waker`" rust#102012 **Link:** https://github.com/rust-lang/rust/issues/102012 ### "Rename `AsyncIterator` back to `Stream`, introduce an AFIT-based `AsyncIterator` trait" rust#119550 **Link:** https://github.com/rust-lang/rust/pull/119550 ### "Clarification needed on what happens when `Future::poll` wakes an old waker" rust#119698 **Link:** https://github.com/rust-lang/rust/issues/119698 ### "Add LocalWaker support" libs-team#191 **Link:** https://github.com/rust-lang/libs-team/issues/191 ### "Context reactor hook" libs-team#347 **Link:** https://github.com/rust-lang/libs-team/issues/347 ## WG RFCs, PRs, and issues nominated for T-lang/T-types ### "Initial support for auto traits with default bounds" rust#120706 **Link:** https://github.com/rust-lang/rust/pull/120706 ### "Add simple async drop glue generation" rust#121801 **Link:** https://github.com/rust-lang/rust/pull/121801 ## Pending PRs on the WG-async repo None. ## `S-waiting-on-team` ### "Rename `AsyncIterator` back to `Stream`, introduce an AFIT-based `AsyncIterator` trait" rust#119550 **Link:** https://github.com/rust-lang/rust/pull/119550 ## Proposed FCPs **Check your boxes!** ### "Tracking Issue for `Ready::into_inner()`" rust#101196 **Link:** https://github.com/rust-lang/rust/issues/101196 ### "Tracking Issue for `const_waker`" rust#102012 **Link:** https://github.com/rust-lang/rust/issues/102012 ## Active FCPs None. ## P-critical issues None. ## WG-async work project board https://github.com/orgs/rust-lang/projects/29/views1/d