Lambda Lifting is a procedure in functional programming where a lambda, otherwise known as a function, is moved from an inner scope, to an outer scope. This move is often done for optimization purposes, or also for necessary implementation purposes.
Rust does not perform lambda lifting as an optimization. Rust does however move lambda bodies into the global scope for implementation purposes. This creates a flat global function scope that plays well with LLVM IR or other possible backends that prefer to work with code blocks than to work with nested symbols.
Below we manually implement lambda lifting for a simple function that captures x, then multiplies by a value y.