-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Tracking Issue for async {}
blocks in const expressions
#85368
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
C-tracking-issue
Category: An issue tracking the progress of sth. like the implementation of an RFC
F-const_async_blocks
`#![feature(const_async_blocks)]`
Comments
jonas-schievink
added
C-tracking-issue
Category: An issue tracking the progress of sth. like the implementation of an RFC
A-const-fn
F-const_async_blocks
`#![feature(const_async_blocks)]`
labels
May 16, 2021
Technically this already existed, but I'll close mine in favor of this one: #69431 |
Ah okay, normally we don't have tracking issues for things that aren't implemented |
Is there anything preventing this from getting stabilized? I'd like to do the remaining work to push this to stabilization. |
CryZe
added a commit
to LiveSplit/asr
that referenced
this issue
May 7, 2023
This allows you to define an asynchronous `main` function instead of the poll based `update` function, which allows you to more easily keep state between individual ticks of the runtime. Unfortunately the most efficient implementation isn't possible yet on stable Rust, as we are blocked by the following two features: - [type_alias_impl_trait](rust-lang/rust#63063) - [const_async_blocks](rust-lang/rust#85368) For now we have to use a workaround that is less efficient by calling the `main` function at runtime and allocating it onto a new WebAssembly page. Here is a full example of how an auto splitter could look like using the `async_main` macro: Usage on stable Rust: ```rust async_main!(stable); ``` Usage on nightly Rust: ```rust async_main!(nightly); ``` The asynchronous main function itself: ```rust async fn main() { // TODO: Set up some general state and settings. loop { let process = Process::wait_attach("explorer.exe").await; process.until_closes(async { // TODO: Load some initial information from the process. loop { // TODO: Do something on every tick. next_tick().await; } }).await; } } ```
CryZe
added a commit
to LiveSplit/asr
that referenced
this issue
May 7, 2023
This allows you to define an asynchronous `main` function instead of the poll based `update` function, which allows you to more easily keep state between individual ticks of the runtime. Unfortunately the most efficient implementation isn't possible yet on stable Rust, as we are blocked by the following two features: - [type_alias_impl_trait](rust-lang/rust#63063) - [const_async_blocks](rust-lang/rust#85368) For now we have to use a workaround that is less efficient by calling the `main` function at runtime and allocating it onto a new WebAssembly page. Here is a full example of how an auto splitter could look like using the `async_main` macro: Usage on stable Rust: ```rust async_main!(stable); ``` Usage on nightly Rust: ```rust async_main!(nightly); ``` The asynchronous main function itself: ```rust async fn main() { // TODO: Set up some general state and settings. loop { let process = Process::wait_attach("explorer.exe").await; process.until_closes(async { // TODO: Load some initial information from the process. loop { // TODO: Do something on every tick. next_tick().await; } }).await; } } ```
CryZe
added a commit
to LiveSplit/asr
that referenced
this issue
May 7, 2023
This allows you to define an asynchronous `main` function instead of the poll based `update` function, which allows you to more easily keep state between individual ticks of the runtime. Unfortunately the most efficient implementation isn't possible yet on stable Rust, as we are blocked by the following two features: - [`type_alias_impl_trait`](rust-lang/rust#63063) - [`const_async_blocks`](rust-lang/rust#85368) For now we have to use a workaround that is less efficient by calling the `main` function at runtime and allocating it onto a new WebAssembly page. Here is a full example of how an auto splitter could look like using the `async_main` macro: Usage on stable Rust: ```rust async_main!(stable); ``` Usage on nightly Rust: ```rust async_main!(nightly); ``` The asynchronous main function itself: ```rust async fn main() { // TODO: Set up some general state and settings. loop { let process = Process::wait_attach("explorer.exe").await; process.until_closes(async { // TODO: Load some initial information from the process. loop { // TODO: Do something on every tick. next_tick().await; } }).await; } } ```
RalfJung
added
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
and removed
A-const-fn
labels
Dec 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
C-tracking-issue
Category: An issue tracking the progress of sth. like the implementation of an RFC
F-const_async_blocks
`#![feature(const_async_blocks)]`
This is a tracking issue for use of
async {}
expressions in const contexts.The feature gate for the issue is
#![feature(const_async_blocks)]
.About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
async {}
expressions in const contexts #85353)Unresolved Questions
Implementation history
The text was updated successfully, but these errors were encountered: