Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
31bd2c9
jsondoclint: simplify code using idiomatic Rust
AmmaarBakshi Apr 11, 2026
a469a4a
rustdoc: correctly display unresolved item for "extern prelude" paths
tonywu6 Apr 29, 2026
f62d536
add move_expr feature flag
TaKO8Ki Apr 9, 2026
98348de
add move(expr) syntax
TaKO8Ki Apr 9, 2026
9abe21c
lower move(expr) in plain closures
TaKO8Ki Apr 9, 2026
0349562
force move(expr) captures to ByValue
TaKO8Ki Apr 9, 2026
7fb00e1
support `ast::ExprKind::Move` in clippy
TaKO8Ki Apr 9, 2026
fa70671
support `ast::ExprKind::Move` in rustfmt
TaKO8Ki Apr 9, 2026
1c2edcc
fix tidy errors
TaKO8Ki Apr 16, 2026
5ea6b0f
add ui tests for move expr
TaKO8Ki Apr 16, 2026
ee5a270
use pre-expansion feature gate, `gate_all!` instead
TaKO8Ki Apr 16, 2026
f848f32
use ExprUseVisitor delegate for explicit move captures
TaKO8Ki Apr 30, 2026
cf937b8
test multiple move expressions in one closure
TaKO8Ki Apr 30, 2026
aac8bd2
add move expression parser ambiguity tests
TaKO8Ki Apr 30, 2026
fc6f09e
document move expression lowering bindings
TaKO8Ki Apr 30, 2026
0158955
document move expression lowering and capture flow
TaKO8Ki Apr 30, 2026
7a80a36
use `HashStable` instead of `HashStable_Generic`
TaKO8Ki Apr 30, 2026
16a446e
collect move exprs during closure lowering
TaKO8Ki May 7, 2026
24d5224
Preserve const block HIR id order
TaKO8Ki May 7, 2026
05f52c7
Have arrays' `drop_glue` just unsize and call the slice version
scottmcm Apr 12, 2026
c1965b5
rustdoc: report unresolved paths that appear invalid
tonywu6 May 9, 2026
8012b9b
rustdoc: adjustment in `collect_intra_doc_links`
tonywu6 May 9, 2026
52ecad9
Add a mir-opt test for `==` on arrays
scottmcm May 10, 2026
1892ccf
rustdoc: change lint message to "invalid path separator" for consistency
tonywu6 May 11, 2026
c468ee3
Simplify `raw_eq` to `Transmute`+`Eq` for sizes with primitives
scottmcm May 11, 2026
22d13e6
document move expression closure lowering
TaKO8Ki May 11, 2026
ae79767
split nested move expression coverage
TaKO8Ki May 11, 2026
632db42
extend nested closure move expression tests
TaKO8Ki May 11, 2026
cb384bf
reject move expressions in async closures
TaKO8Ki May 11, 2026
ec2eaff
move closure lowering into expr::closure
TaKO8Ki May 11, 2026
fdcbe90
LLVM 23: Accept float (instead of hex) literals in codegen tests
TimNN May 11, 2026
8bd0b7a
LLVM 23: Specify `returnaddress` intrinsic return type
TimNN May 11, 2026
a194d65
Refactor `CheckAttrVisitor` so rustfmt can format it.
kpreid May 11, 2026
275284b
Rollup merge of #155023 - TaKO8Ki:move-expr-1, r=nikomatsakis
JonathanBrouwer May 11, 2026
bd2d904
Rollup merge of #156429 - scottmcm:raw-eq-transmute, r=oli-obk
JonathanBrouwer May 11, 2026
c363092
Rollup merge of #155169 - AmmaarBakshi:jsondoclint-cleanup, r=camelid
JonathanBrouwer May 11, 2026
b6e3cf8
Rollup merge of #155184 - scottmcm:intercept-array-drop-shim, r=Waffl…
JonathanBrouwer May 11, 2026
ac50f9a
Rollup merge of #156022 - tonywu6:main, r=lolbinarycat
JonathanBrouwer May 11, 2026
b43b17d
Rollup merge of #156461 - TimNN:retty, r=nikic
JonathanBrouwer May 11, 2026
ef7d205
Rollup merge of #156462 - TimNN:flit, r=nikic
JonathanBrouwer May 11, 2026
502d127
Rollup merge of #156466 - kpreid:checkattr, r=JonathanBrouwer
JonathanBrouwer May 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,7 @@ impl Expr {
// need parens sometimes. E.g. we can print `(let _ = a) && b` as `let _ = a && b`
// but we need to print `(let _ = a) < b` as-is with parens.
| ExprKind::Let(..)
| ExprKind::Move(..)
| ExprKind::Unary(..) => ExprPrecedence::Prefix,

// Need parens if and only if there are prefix attributes.
Expand Down Expand Up @@ -1763,6 +1764,8 @@ pub enum ExprKind {
Binary(BinOp, Box<Expr>, Box<Expr>),
/// A unary operation (e.g., `!x`, `*x`).
Unary(UnOp, Box<Expr>),
/// A `move(expr)` expression.
Move(Box<Expr>, Span),
/// A literal (e.g., `1`, `"foo"`).
Lit(token::Lit),
/// A cast (e.g., `foo as f64`).
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_ast/src/util/classify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ pub fn leading_labeled_expr(mut expr: &ast::Expr) -> bool {
Assign(e, _, _)
| AssignOp(_, e, _)
| Await(e, _)
| Move(e, _)
| Use(e, _)
| Binary(_, e, _)
| Call(e, _)
Expand Down Expand Up @@ -183,6 +184,7 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<TrailingBrace<'_>> {
| Ret(Some(e))
| Unary(_, e)
| Yeet(Some(e))
| Move(e, _)
| Become(e) => {
expr = e;
}
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_ast/src/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,9 @@ macro_rules! common_visitor_and_walkers {
visit_visitable!($($mut)? vis, block, opt_label),
ExprKind::Gen(capt, body, kind, decl_span) =>
visit_visitable!($($mut)? vis, capt, body, kind, decl_span),
ExprKind::Await(expr, span) | ExprKind::Use(expr, span) =>
ExprKind::Await(expr, span)
| ExprKind::Move(expr, span)
| ExprKind::Use(expr, span) =>
visit_visitable!($($mut)? vis, expr, span),
ExprKind::Assign(lhs, rhs, span) =>
visit_visitable!($($mut)? vis, lhs, rhs, span),
Expand Down
7 changes: 7 additions & 0 deletions compiler/rustc_ast_lowering/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ pub(crate) struct ClosureCannotBeStatic {
pub fn_decl_span: Span,
}

#[derive(Diagnostic)]
#[diag("`move(expr)` is only supported in plain closures")]
pub(crate) struct MoveExprOnlyInPlainClosures {
#[primary_span]
pub span: Span,
}

#[derive(Diagnostic)]
#[diag("functional record updates are not allowed in destructuring assignments")]
pub(crate) struct FunctionalRecordUpdateDestructuringAssignment {
Expand Down
Loading
Loading