-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
197: API, Rustc: Add `AwaitExpr` and support `async` blocks and fns r=xFrednet a=xFrednet Basically, what the title says :D --- Async and await stuff in rustc heavily relies on syntax sugar. A simple `.await` call is transformed into one loop and two match statements etc. This far Marker has always *resugared* this syntax, for two reasons: 1. I believe that the exact desugar of expressions is allowed to change. 2. The desugar is often harder to understand. In this case, I've decided to also resugar the expressions. For `.await` expressions, I'm sure that this is the right call. However, async blocks and functions might be different. For example: ```rust async fn foo() -> u8 { 16 } ``` The function actually has the return type `impl Future<Output = u8>` and not `u8` like the AST node currently says. The `impl Future<Output = u8>` can still be retrieved as the semantic type of the expression. The basic question I currently have is: Is resugaring the output of the function to `u8` okay, or should it still say `impl Future<Output = u8>` even if the user didn't write it? Personally, I like this resugar, but I haven't worked too much with async. --- `@Veetaha` you said previously that you work with async. Do you maybe have any thoughts on this? (I hope it's okay that I ping you, if not, please tell me, and I will refrain from it in the future) --- Closes #174 Co-authored-by: xFrednet <xFrednet@gmail.com>
- Loading branch information
Showing
26 changed files
with
1,323 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.