Skip to content

Introduce move expressions (move($expr)) - #155023

Merged
rust-bors[bot] merged 22 commits into
rust-lang:mainfrom
TaKO8Ki:move-expr-1
May 12, 2026
Merged

rust-bors[bot] merged 22 commits into
rust-lang:mainfrom
TaKO8Ki:move-expr-1

Conversation

@TaKO8Ki

@TaKO8Ki TaKO8Ki commented Apr 9, 2026 •

Copy link
Copy Markdown
Member

View all comments

This is an experimental first version of move expressions.

This first version implements it just in plain closures. A support for coroutine closures will be added in follow up pull requests.

RFC: will be added later
Tracking issue: #155050
Project goal:

r? @nikomatsakis

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 9, 2026
@rustbot rustbot added T-clippy Relevant to the Clippy team. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels Apr 9, 2026
@rust-lang rust-lang deleted a comment from rust-log-analyzer Apr 9, 2026
@rust-lang rust-lang deleted a comment from rust-log-analyzer Apr 9, 2026
@rust-lang rust-lang deleted a comment from rust-log-analyzer Apr 9, 2026
@TaKO8Ki TaKO8Ki changed the title Move expressions (move($expr)) Introduce move expressions (move($expr)) Apr 9, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@TaKO8Ki
TaKO8Ki marked this pull request as ready for review April 16, 2026 12:26
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 16, 2026
@rustbot

rustbot commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 16, 2026
Comment thread compiler/rustc_ast_passes/src/feature_gate.rs Outdated
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 16, 2026
Comment thread tests/ui/feature-gates/feature-gate-move_expr.stderr
Comment thread compiler/rustc_ast_lowering/src/expr.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/expr.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/expr.rs
Comment thread compiler/rustc_ast_lowering/src/expr.rs
Comment thread compiler/rustc_hir/src/hir.rs Outdated
Comment thread tests/ui/move-expr/plain-closure.rs
Comment thread compiler/rustc_hir_typeck/src/upvar.rs
Comment thread compiler/rustc_hir_typeck/src/upvar.rs
Comment thread compiler/rustc_hir_typeck/src/upvar.rs Outdated
@rust-bors

This comment has been minimized.

@rustbot

This comment has been minimized.

@TaKO8Ki
TaKO8Ki requested a review from nikomatsakis April 30, 2026 12:26
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 30, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 30, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 11, 2026
Introduce move expressions (`move($expr)`) 





This is an experimental first version of move expressions.

This first version implements it just in plain closures. A support for coroutine closures will be added in follow up pull requests.

RFC: will be added later
Tracking issue: #155050
Project goal:
- rust-lang/goals#107
- https://rust-lang.github.io/rust-project-goals/2026/ergonomic-rc.html

r? @nikomatsakis
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 11, 2026
@rust-bors

rust-bors Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 0a3949b failed: CI. Failed job:

@TaKO8Ki

TaKO8Ki commented May 11, 2026

Copy link
Copy Markdown
Member Author

@bors retry

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 11, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 11, 2026
Introduce move expressions (`move($expr)`) 





This is an experimental first version of move expressions.

This first version implements it just in plain closures. A support for coroutine closures will be added in follow up pull requests.

RFC: will be added later
Tracking issue: #155050
Project goal:
- rust-lang/goals#107
- https://rust-lang.github.io/rust-project-goals/2026/ergonomic-rc.html

r? @nikomatsakis
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 11, 2026
@rust-bors

rust-bors Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

💔 Test for e21651e failed: CI. Failed job:

@RalfJung

Copy link
Copy Markdown
Member

@bors retry The push refers to repository [ghcr.io/rust-lang/rust-ci] ... received unexpected HTTP status: 502 Bad Gateway

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 11, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test expr_store::scope::tests::test_resolve_local_name ... ok
test expr_store::tests::body::array_element_cfg ... ok
test expr_store::tests::body::block::inner_item_smoke ... ok
test expr_store::scope::tests::while_let_adds_binding ... ok
error: test failed, to rerun pass `-p hir-def --lib`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/hir_def-f381e8bd2208ec8b '--skip=tests::smoke_test_real_sysroot_cargo' --skip=check_code_formatting -Z unstable-options --format json` (signal: 11, SIGSEGV: invalid memory reference)
Bootstrap failed while executing `--stage 2 test --skip tests --skip coverage-map --skip coverage-run --skip library --skip tidyselftest`
Build completed unsuccessfully in 1:10:34
  local time: Mon May 11 16:30:31 UTC 2026
  network time: Mon, 11 May 2026 16:30:31 GMT
##[error]Process completed with exit code 1.

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 11, 2026
Introduce move expressions (`move($expr)`)

This is an experimental first version of move expressions.

This first version implements it just in plain closures. A support for coroutine closures will be added in follow up pull requests.

RFC: will be added later
Tracking issue: rust-lang#155050
Project goal:
- rust-lang/goals#107
- https://rust-lang.github.io/rust-project-goals/2026/ergonomic-rc.html

r? @nikomatsakis
rust-bors Bot pushed a commit that referenced this pull request May 11, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #156448 (miri subtree update)
 - #155023 (Introduce move expressions (`move($expr)`) )
 - #156429 (Simplify `intrinsic::raw_eq` in MIR when possible)
 - #147672 (LLBC-linker: Do not strip debug symbols for the nvptx target anymore)
 - #155169 (jsondoclint: simplify code using idiomatic Rust)
 - #155184 ( Have arrays' `drop_glue` just unsize and call the slice version)
 - #156022 (rustdoc: Fix cosmetic issues when reporting unresolved paths in `broken_intra_doc_links`)
 - #156442 (Show intrinsics::gpu in docs)
 - #156461 (LLVM 23: Specify `returnaddress` intrinsic return type)
 - #156462 (LLVM 23: Accept float (instead of hex) literals in codegen tests)
 - #156466 (Refactor `CheckAttrVisitor` so rustfmt can format it.)
@rust-bors
rust-bors Bot merged commit 1db77ea into rust-lang:main May 12, 2026
3 of 12 checks passed
@rustbot rustbot added this to the 1.97.0 milestone May 12, 2026
rust-timer added a commit that referenced this pull request May 12, 2026
Rollup merge of #155023 - TaKO8Ki:move-expr-1, r=nikomatsakis

Introduce move expressions (`move($expr)`)

This is an experimental first version of move expressions.

This first version implements it just in plain closures. A support for coroutine closures will be added in follow up pull requests.

RFC: will be added later
Tracking issue: #155050
Project goal:
- rust-lang/goals#107
- https://rust-lang.github.io/rust-project-goals/2026/ergonomic-rc.html

r? @nikomatsakis
@TaKO8Ki
TaKO8Ki deleted the move-expr-1 branch May 12, 2026 08:33
WhySoBad pushed a commit to WhySoBad/miri that referenced this pull request May 13, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#156448 (miri subtree update)
 - rust-lang/rust#155023 (Introduce move expressions (`move($expr)`) )
 - rust-lang/rust#156429 (Simplify `intrinsic::raw_eq` in MIR when possible)
 - rust-lang/rust#147672 (LLBC-linker: Do not strip debug symbols for the nvptx target anymore)
 - rust-lang/rust#155169 (jsondoclint: simplify code using idiomatic Rust)
 - rust-lang/rust#155184 ( Have arrays' `drop_glue` just unsize and call the slice version)
 - rust-lang/rust#156022 (rustdoc: Fix cosmetic issues when reporting unresolved paths in `broken_intra_doc_links`)
 - rust-lang/rust#156442 (Show intrinsics::gpu in docs)
 - rust-lang/rust#156461 (LLVM 23: Specify `returnaddress` intrinsic return type)
 - rust-lang/rust#156462 (LLVM 23: Accept float (instead of hex) literals in codegen tests)
 - rust-lang/rust#156466 (Refactor `CheckAttrVisitor` so rustfmt can format it.)
flip1995 pushed a commit to flip1995/rust that referenced this pull request May 13, 2026
Introduce move expressions (`move($expr)`)

This is an experimental first version of move expressions.

This first version implements it just in plain closures. A support for coroutine closures will be added in follow up pull requests.

RFC: will be added later
Tracking issue: rust-lang#155050
Project goal:
- rust-lang/goals#107
- https://rust-lang.github.io/rust-project-goals/2026/ergonomic-rc.html

r? @nikomatsakis
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Aug 17, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#156448 (miri subtree update)
 - rust-lang/rust#155023 (Introduce move expressions (`move($expr)`) )
 - rust-lang/rust#156429 (Simplify `intrinsic::raw_eq` in MIR when possible)
 - rust-lang/rust#147672 (LLBC-linker: Do not strip debug symbols for the nvptx target anymore)
 - rust-lang/rust#155169 (jsondoclint: simplify code using idiomatic Rust)
 - rust-lang/rust#155184 ( Have arrays' `drop_glue` just unsize and call the slice version)
 - rust-lang/rust#156022 (rustdoc: Fix cosmetic issues when reporting unresolved paths in `broken_intra_doc_links`)
 - rust-lang/rust#156442 (Show intrinsics::gpu in docs)
 - rust-lang/rust#156461 (LLVM 23: Specify `returnaddress` intrinsic return type)
 - rust-lang/rust#156462 (LLVM 23: Accept float (instead of hex) literals in codegen tests)
 - rust-lang/rust#156466 (Refactor `CheckAttrVisitor` so rustfmt can format it.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants