rust/tests
bors 208dd2032b Auto merge of #118847 - eholk:for-await, r=compiler-errors
Add support for `for await` loops

This adds support for `for await` loops. This includes parsing, desugaring in AST->HIR lowering, and adding some support functions to the library.

Given a loop like:
```rust
for await i in iter {
    ...
}
```
this is desugared to something like:
```rust
let mut iter = iter.into_async_iter();
while let Some(i) = loop {
    match core::pin::Pin::new(&mut iter).poll_next(cx) {
        Poll::Ready(i) => break i,
        Poll::Pending => yield,
    }
} {
    ...
}
```

This PR also adds a basic `IntoAsyncIterator` trait. This is partly for symmetry with the way `Iterator` and `IntoIterator` work. The other reason is that for async iterators it's helpful to have a place apart from the data structure being iterated over to store state. `IntoAsyncIterator` gives us a good place to do this.

I've gated this feature behind `async_for_loop` and opened #118898 as the feature tracking issue.

r? `@compiler-errors`
2023-12-22 14:17:10 +00:00
..
assembly Auto merge of #118491 - cuviper:aarch64-stack-probes, r=wesleywiser 2023-12-14 02:01:13 +00:00
auxiliary
codegen Auto merge of #119056 - cjgillot:codegen-overalign, r=wesleywiser 2023-12-21 04:01:36 +00:00
codegen-units
coverage coverage: Add a test for async blocks 2023-12-20 18:48:04 +11:00
coverage-run-rustdoc
debuginfo
incremental rustc_codegen_ssa: Don't let IncorrectCguReuseType errors get lost 2023-12-19 20:20:40 +01:00
mir-opt Auto merge of #119112 - Nadrieril:remove-target_blocks-hack, r=matthewjasper 2023-12-19 21:15:31 +00:00
pretty Improve print_tts by changing tokenstream::Spacing. 2023-12-11 09:19:09 +11:00
run-make Improve print_tts by changing tokenstream::Spacing. 2023-12-11 09:19:09 +11:00
run-make-fulldeps Merge Queries::{ongoing_codegen,linker}. 2023-11-22 13:22:49 +11:00
run-pass-valgrind
rustdoc Rollup merge of #113091 - GuillaumeGomez:prevent-cfg-merge-reexport, r=rustdoc 2023-12-15 11:51:23 +01:00
rustdoc-gui Rollup merge of #118988 - notriddle:notriddle/varconst, r=GuillaumeGomez 2023-12-15 20:19:56 +01:00
rustdoc-js rustdoc-search: remove parallel searchWords array 2023-12-15 16:26:35 -07:00
rustdoc-js-std Auto merge of #118077 - calebzulawski:sync-portable-simd-2023-11-19, r=workingjubilee 2023-12-02 18:04:01 +00:00
rustdoc-json
rustdoc-ui Simple modification of diagnostic information 2023-12-21 10:17:11 +08:00
ui Auto merge of #118847 - eholk:for-await, r=compiler-errors 2023-12-22 14:17:10 +00:00
ui-fulldeps Auto merge of #119097 - nnethercote:fix-EmissionGuarantee, r=compiler-errors 2023-12-22 00:03:57 +00:00
COMPILER_TESTS.md