Skip to main content

Module Safe

Module Safe 

Source

Structsยง

FreeIdentCollector ๐Ÿ”’
MoveDetector ๐Ÿ”’
NodeCounter ๐Ÿ”’
UnsafeDetector ๐Ÿ”’

Functionsยง

CollectFreeIdents ๐Ÿ”’
ContainsUnsafe
IsFreeVarSafe
Returns true when every plain-identifier free variable inside Init remains live (not moved by value) in the statements that appear between the candidate let-binding (exclusive) and the substitution site (exclusive).
IsMovedInStmts ๐Ÿ”’
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:
IsSafe
Returns true when E is safe to substitute at its single use site, considering only the expression itself (size and unsafe).
NodeCount