Skip to main content

IsMovedInStmts

Function IsMovedInStmts 

Source
fn IsMovedInStmts(Target: &str, Stmts: &[Stmt]) -> bool
Expand description

Returns true when Target is consumed by value in any of the statements. We detect by-value consumption conservatively: if Target appears as a plain Expr::Path (bare identifier, no & / &mut / ref prefix) in a position that syntactically transfers ownership:

  • a function or method call argument
  • a struct / tuple-struct field value (shorthand or explicit)
  • the right-hand side of a let initialiser or assignment
  • an array element, tuple element, or return expression