Uh oh!
There was an error while loading. Please reload this page.
Place tail expression behind terminating scope - #125293
Merged
Merged
Conversation
rustbot
commented
May 19, 2024
Collaborator
rustbot has assigned @petrochenkov. Use |
ContributorAuthor
cc @traviscross for edition 2024 update cc @eholk for context who has worked on async iterator |
Closed
13 tasks
petrochenkov
commented
May 22, 2024
Contributor
r? compiler |
This comment was marked as resolved.
This comment was marked as resolved.
dingxiangfei2009force-pushed
the
tail-expr-temp-lifetime
branch
from
May 26, 2024 20:30
21d1190 to
2f0ad0dCompareUh oh!
There was an error while loading. Please reload this page.
dingxiangfei2009force-pushed
the
tail-expr-temp-lifetime
branch
4 times, most recently
from
June 5, 2024 14:56
66c2762 to
5b86c0dComparetraviscross
commented
Jun 11, 2024
Contributor
r? @estebank |
davidtwco
approved these changes
Jun 12, 2024
davidtwco
left a comment
Member
There was a problem hiding this comment.
LGTM, but I'll let Esteban review it too
estebank
commented
Jun 13, 2024
Contributor
@bors r=estebank,davidtwco |
bors
commented
Jun 13, 2024
Collaborator
matthiaskrgr added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jun 14, 2024
…fetime, r=estebank,davidtwco Place tail expression behind terminating scope This PR implements rust-lang#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) } { ... } } ```
bors added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 14, 2024
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#125293 (Place tail expression behind terminating scope) - rust-lang#125722 (Indicate in `non_local_defs` lint that the macro needs to change) - rust-lang#126192 (Various Redox OS fixes and add i686 Redox OS target) - rust-lang#126285 (`UniqueRc`: support allocators and `T: ?Sized`.) - rust-lang#126352 (ci: Update centos:7 to use vault repos) - rust-lang#126399 (extend the check for LLVM build) r? `@ghost` `@rustbot` modify labels: rollup
matthiaskrgr
commented
Jun 14, 2024
Member
dingxiangfei2009force-pushed
the
tail-expr-temp-lifetime
branch
from
June 17, 2024 20:14
5b86c0d to
0f8c3f7Comparedingxiangfei2009
commented
Jun 17, 2024
ContributorAuthor
@matthiaskrgr would you mind giving it another shot? 🙏 |
dingxiangfei2009
commented
Jun 17, 2024
ContributorAuthor
@bors try |
bors
commented
Jun 17, 2024
Collaborator
@dingxiangfei2009: 🔑 Insufficient privileges: not in try users |
This comment was marked as resolved.
This comment was marked as resolved.
ehuss
commented
Jun 18, 2024
Contributor
Tested locally and it seems to pass. @bors r=estebank,davidtwco |
bors
commented
Jun 18, 2024
Collaborator
jieyouxu added a commit
to jieyouxu/rust
that referenced
this pull request
Jun 19, 2024
…fetime, r=estebank,davidtwco Place tail expression behind terminating scope This PR implements rust-lang#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) } { ... } } ```
This was referenced Jun 19, 2024
bors added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 19, 2024
Rollup of 10 pull requests Successful merges: - rust-lang#124135 (delegation: Implement glob delegation) - rust-lang#125078 (fix: break inside async closure has incorrect span for enclosing closure) - rust-lang#125293 (Place tail expression behind terminating scope) - rust-lang#126422 (Suggest using a standalone doctest for non-local impl defs) - rust-lang#126493 (safe transmute: support non-ZST, variantful, uninhabited enums) - rust-lang#126504 (Sync fuchsia test runner with clang test runner) - rust-lang#126558 (hir_typeck: be more conservative in making "note caller chooses ty param" note) - rust-lang#126586 (Add `@badboy` and `@BlackHoleFox` as Mac Catalyst maintainers) - rust-lang#126615 (Add `rustc-ice*` to `.gitignore`) - rust-lang#126632 (Replace `move||` with `move ||`) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 19, 2024
Rollup merge of rust-lang#125293 - dingxiangfei2009:tail-expr-temp-lifetime, r=estebank,davidtwco Place tail expression behind terminating scope This PR implements rust-lang#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) } { ... } } ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements #123739 so that we can do further experiments in nightly.
A little rewrite has been applied to
for awaitlowering. It was previouslyunsafe { Pin::unchecked_new(into_async_iter(..)) }. Under the edition 2024 rule, however,into_async_itergets dropped at the end of theunsafeblock. This presumably the first Edition 2024 migration rule goes by hoistinginto_async_iter(..)intomatchone level above, so it now looks like the following.