Skip to content

Conversation

m4rch3n1ng
Copy link
Contributor

@m4rch3n1ng m4rch3n1ng commented Mar 6, 2025

parse async closures. see reference

i just added it as an optional modifier to the (closure_expression), like with async functions, instead of as a seperate node like (async_block), but i can change that if you want me to.

the reference doesn't specify how static closures work, but in my testing rustc does not want to give an ast for async static move, but gives an ast for static async move.

diff for #229:

this is actually a pretty substantial diff wow
--- .tmp/list.txt	2025-03-03 17:25:16.906975980 +0100
+++ .tmp/list.txt.async-closures	2025-03-03 17:19:07.415680818 +0100
@@ -1,4 +1,3 @@
-tests/codegen/async-closure-debug.rs
 tests/codegen/dst-offset.rs
 tests/codegen/function-arguments.rs
 tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-user-defined-types.rs
@@ -12,13 +11,11 @@
 tests/crashes/104685.rs
 tests/crashes/116979.rs
 tests/crashes/123887.rs
-tests/debuginfo/coroutine-closure.rs
 tests/debuginfo/coroutine-locals.rs
 tests/debuginfo/coroutine-objects.rs
 tests/debuginfo/function-names.rs
 tests/debuginfo/issue-57822.rs
 tests/debuginfo/type-names.rs
-tests/mir-opt/async_closure_shims.rs
 tests/mir-opt/building/match/never_patterns.rs
 tests/mir-opt/coroutine_drop_cleanup.rs
 tests/mir-opt/coroutine_storage_dead_unwind.rs
@@ -51,24 +48,10 @@
 tests/ui/associated-types/default-associated-types.rs
 tests/ui/associated-types/issue-25339.rs
 tests/ui/associated-types/issue-32350.rs
-tests/ui/async-await/async-closures/call-once-deduction.rs
-tests/ui/async-await/async-closures/constrained-but-no-upvars-yet.rs
-tests/ui/async-await/async-closures/different-projection-lengths-for-different-upvars.rs
-tests/ui/async-await/async-closures/implements-fnmut.rs
-tests/ui/async-await/async-closures/inline-body.rs
-tests/ui/async-await/async-closures/mac-body.rs
-tests/ui/async-await/async-closures/moro-example.rs
-tests/ui/async-await/async-closures/no-borrow-from-env.rs
-tests/ui/async-await/async-closures/sig-from-bare-fn.rs
-tests/ui/async-await/async-closures/signature-deduction.rs
-tests/ui/async-await/async-closures/signature-inference-from-two-part-bound.rs
-tests/ui/async-await/async-closures/truncated-fields-when-imm.rs
-tests/ui/async-await/async-closures/validate-synthetic-body.rs
 tests/ui/async-await/async-fn/sugar.rs
 tests/ui/async-await/for-await-passthrough.rs
 tests/ui/async-await/for-await.rs
 tests/ui/async-await/issues/issue-65419/issue-65419-coroutine-resume-after-completion.rs
-tests/ui/async-await/no-params-non-move-async-closure.rs
 tests/ui/async-await/pin-ergonomics/sugar.rs
 tests/ui/async-await/return-type-notation/issue-110963-late.rs
 tests/ui/async-await/return-type-notation/normalizing-self-auto-trait-issue-109924.rs
@@ -235,7 +218,6 @@
 tests/ui/macros/user-defined-macro-rules.rs
 tests/ui/match/postfix-match/no-unused-parens.rs
 tests/ui/match/postfix-match/pf-match-chain.rs
-tests/ui/mir/issue-68841.rs
 tests/ui/nll/assign-while-to-immutable.rs
 tests/ui/nll/empty-type-predicate.rs
 tests/ui/nll/issue-112604-closure-output-normalize.rs
@@ -257,7 +239,6 @@
 tests/ui/rust-2018/uniform-paths/from-decl-macro.rs
 tests/ui/rust-2024/unsafe-extern-blocks/extern-items.rs
 tests/ui/rust-2024/unsafe-extern-blocks/safe-items.rs
-tests/ui/sanitizer/cfi/async-closures.rs
 tests/ui/simd/masked-load-store.rs
 tests/ui/sized/coinductive-1-gat.rs
 tests/ui/specialization/assoc-ty-graph-cycle.rs

@m4rch3n1ng m4rch3n1ng force-pushed the async-closures branch 2 times, most recently from 398210f to 4ec3ecb Compare March 7, 2025 01:09
@maxbrunsfeld
Copy link
Contributor

🎉 That list of failing files is getting pretty small.

@maxbrunsfeld maxbrunsfeld merged commit 5b8dd57 into tree-sitter:master Apr 1, 2025
4 checks passed
@m4rch3n1ng
Copy link
Contributor Author

it is getting smaller, i'll post an update soon on that specific issue with what is left and some additional notes. for now another round of rebases is due ... thanks for merging this!

@m4rch3n1ng m4rch3n1ng deleted the async-closures branch April 1, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants