diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-12-24 16:28:46 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-24 16:28:46 +0000 |
commit | 3f7e5cde0b80b19095bf7e4d40f88d418a3c5921 (patch) | |
tree | 03339444fa1f56b6549cca23822d119ee95f5d31 /crates/ra_syntax/src/ast/extensions.rs | |
parent | aa49b79bda5b7cafbaa33c302a9974133d34c52b (diff) | |
parent | 208ad97fdc9427f1243ac170c1c25f9f7d6ae964 (diff) |
Merge #2661
2661: Implement infer await from async function r=flodiebold a=edwin0cheng
This PR is my attempt for trying to add support for infer `.await` expression from an `async` function, by desugaring its return type to `Impl Future<Output=RetType>`.
Note that I don't know it is supposed to desugaring it in that phase, if it is not suitable in current design, just feel free to reject it :)
r=@flodiebold
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/ast/extensions.rs')
-rw-r--r-- | crates/ra_syntax/src/ast/extensions.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs index a8f625176..baaef3023 100644 --- a/crates/ra_syntax/src/ast/extensions.rs +++ b/crates/ra_syntax/src/ast/extensions.rs | |||
@@ -221,6 +221,10 @@ impl ast::FnDef { | |||
221 | .and_then(|it| it.into_token()) | 221 | .and_then(|it| it.into_token()) |
222 | .filter(|it| it.kind() == T![;]) | 222 | .filter(|it| it.kind() == T![;]) |
223 | } | 223 | } |
224 | |||
225 | pub fn is_async(&self) -> bool { | ||
226 | self.syntax().children_with_tokens().any(|it| it.kind() == T![async]) | ||
227 | } | ||
224 | } | 228 | } |
225 | 229 | ||
226 | impl ast::LetStmt { | 230 | impl ast::LetStmt { |