Parameter modes

A mode sits between the parameter name and its type, and a non-default mode is written again at the call site. A reader of the call knows whether the binding survives it, and in what state, without opening the callee.

ModeMeaningAt the call
letborrowed, read-only (the default)read(s)
mutableborrowed, may be mutated in placewrite(mutable s)
takeownership moves to the calleeconsume(take s)
initcallee fills an uninit bindingproduce(init t)

A linear T must be consumed exactly once on every path; an affine T may be dropped. Passing by let does not consume the value. Only take does.