diff options
| author | 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com> | 2024-06-19 01:51:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-19 01:51:38 +0100 |
| commit | 8eb2e5f4c887c4d89e4989ae8c1898d2204c41c3 (patch) | |
| tree | 4f5e94a63cbc302ccba64c0f0d6026e219647849 /compiler/rustc_feature/src | |
| parent | c9a9d5cee7f0c0a8c947044c63a6cb5ea1254590 (diff) | |
| parent | 0f8c3f78825a1b6eb765b97f658b92252b55c5df (diff) | |
| download | rust-8eb2e5f4c887c4d89e4989ae8c1898d2204c41c3.tar.gz rust-8eb2e5f4c887c4d89e4989ae8c1898d2204c41c3.zip | |
Rollup merge of #125293 - dingxiangfei2009:tail-expr-temp-lifetime, r=estebank,davidtwco
Place tail expression behind terminating scope
This PR implements #123739 so that we can do further experiments in nightly.
A little rewrite has been applied to `for await` lowering. It was previously `unsafe { Pin::unchecked_new(into_async_iter(..)) }`. Under the edition 2024 rule, however, `into_async_iter` gets dropped at the end of the `unsafe` block. This presumably the first Edition 2024 migration rule goes by hoisting `into_async_iter(..)` into `match` one level above, so it now looks like the following.
```rust
match into_async_iter($iter_expr) {
ref mut iter => match unsafe { Pin::unchecked_new(iter) } {
...
}
}
```
Diffstat (limited to 'compiler/rustc_feature/src')
| -rw-r--r-- | compiler/rustc_feature/src/unstable.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 066a5a8f046..5cfbcdcbbbe 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -588,6 +588,8 @@ declare_features! ( (incomplete, return_type_notation, "1.70.0", Some(109417)), /// Allows `extern "rust-cold"`. (unstable, rust_cold_cc, "1.63.0", Some(97544)), + /// Shortern the tail expression lifetime + (unstable, shorter_tail_lifetimes, "1.79.0", Some(123739)), /// Allows the use of SIMD types in functions declared in `extern` blocks. (unstable, simd_ffi, "1.0.0", Some(27731)), /// Allows specialization of implementations (RFC 1210). |
