Files
rust/compiler/rustc_interface
Jonathan Brouwer c336759961 Rollup merge of #163336 - Amanieu:move-elimination/tail-copy-to-move, r=tmiasko
MIR move elimination [2/6]: TailCopyToMove

Depends on rust-lang/rust#163335

This PR implements a pre-pass for the `MoveElimination` pass from https://github.com/rust-lang/rfcs/pull/3943.

`TailCopyToMove` turns `Copy` into `Move` just before a `Return` terminator. This is valid even for places that have been borrowed because the `Return` will invalidate borrows anyway. This is necessary to allow the source of the copy to be unified with the return place.

r? tmiasko
2026-09-30 10:20:58 +02:00
..