Move Semantics: Different Scope
Overview
Ownership is always tied to scope. When a value is moved, the previous binding becomes invalid, and cleanup happens when the current owner goes out of scope.
This rule is especially important across nested scopes, where validity and drops depend on who owns the value at each point.
Official Rust Book: Variables and Data Interacting with Move