borrowing
Syntax
Semantics
Borrowing creates a read-only binding to an existing value.
yis an alias to the current SSA version ofx- No mutation is permitted through
y xmay still be updated or reboundyremains bound to the original value
Borrowing restricts names, not data.
Properties
- Read-only
- No reassignment
- No array updates
- No heap or pointer semantics
- No lifetime tracking
- Erased before SMT generation
Example
Forbidden Operations
y = 10; // error: cannot assign to borrowed variable
y[0] = 10; // error: cannot update borrowed variable
Notes
- Borrowing does not copy or move the value
- Borrowed bindings never consume their source
- Borrowing introduces no additional SMT variables