book icon indicating copy to clipboard operation
book copied to clipboard

Clarify that variables can be immutable, not values.

Open svr8450 opened this issue 3 years ago • 0 comments

It is a common misconception from rust beginners that rust has "immutable values", something found in other languages. The current text seems to imply that a value could gain a special status of immutability via assignment to an immutable binding. This change attempts to sidestep that misconception by being a little more strict with using the adjective "immutable" to refer to variables only, not their values.

This also conveniently avoids even the slightest untruthfulness about interior-mutable values (i.e. those containing UnsafeCell). While this is certainly not an important caveat to the beginner this early in the book and so isn't mentioned in the text, strict accuracy can help when the book is used as a reference source.

svr8450 avatar Jul 11 '22 04:07 svr8450