rust/tests
bors 4a2fe4491e Auto merge of #120361 - compiler-errors:async-closures, r=oli-obk
Rework support for async closures; allow them to return futures that borrow from the closure's captures

This PR implements a new lowering for async closures via `TyKind::CoroutineClosure` which handles the curious relationship between the closure and the coroutine that it returns.

I wrote up a bunch in [this hackmd](https://hackmd.io/`@compiler-errors/S1HvqQxca)` which will be copied to the dev guide after this PR lands, and hopefully left sufficient comments in the source code explaining why this change is as large as it is.

This also necessitates that they begin implementing the `AsyncFn`-family of traits, rather than the `Fn`-family of traits -- if you need `Fn` implementations, you should probably use the non-sugar `|| async {}` syntax instead.

Notably this PR does not yet implement `async Fn()` syntax sugar for bounds, but I expect to add those soon (**edit:** #120392). For now, users must use `AsyncFn()` traits directly, which necessitates adding the `async_fn_traits` feature gate as well. I will add this as a follow-up very soon.

r? oli-obk

This is based on top of #120322, but that PR is minimal.
2024-02-06 15:04:01 +00:00
..
assembly Revert "Add the wasm32-wasi-preview2 target" 2024-01-28 02:02:50 +01:00
auxiliary
codegen Auto merge of #120624 - matthiaskrgr:rollup-3gvcl20, r=matthiaskrgr 2024-02-04 20:51:28 +00:00
codegen-units
coverage coverage: Make unexpansion of closure bodies more precise 2024-02-05 10:09:46 +11:00
coverage-run-rustdoc
debuginfo Update tests. 2024-01-27 16:38:57 +01:00
incremental fix rebase 2024-02-01 22:38:16 +00:00
mir-opt Fix drop shim for AsyncFnOnce closure, AsyncFnMut shim for AsyncFn closure 2024-02-06 02:22:58 +00:00
pretty Auto merge of #120227 - nnethercote:further-improve-space_between, r=petrochenkov 2024-01-31 02:01:43 +00:00
run-make Update data layouts in custom target tests for LLVM 18 2024-01-31 15:15:59 +01:00
run-make-fulldeps
run-pass-valgrind
rustdoc Rollup merge of #120501 - GuillaumeGomez:glob-reexport-attr-merge-bugfix, r=notriddle 2024-01-31 12:10:53 +01:00
rustdoc-gui
rustdoc-js
rustdoc-js-std
rustdoc-json
rustdoc-ui Rollup merge of #116284 - RalfJung:no-nan-match, r=cjgillot 2024-02-05 11:07:26 +01:00
ui Auto merge of #120361 - compiler-errors:async-closures, r=oli-obk 2024-02-06 15:04:01 +00:00
ui-fulldeps Add CoroutineClosure to TyKind, AggregateKind, UpvarArgs 2024-02-06 02:22:58 +00:00
COMPILER_TESTS.md