We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 763f923 commit f07aa35Copy full SHA for f07aa35
src/doc/book/variable-bindings.md
@@ -240,7 +240,10 @@ println!("{}", x); // Prints "42"
240
Shadowing and mutable bindings may appear as two sides of the same coin, but
241
they are two distinct concepts that can't always be used interchangeably. For
242
one, shadowing enables us to rebind a name to a value of a different type. It
243
-is also possible to change the mutability of a binding.
+is also possible to change the mutability of a binding. Note that shadowing a
244
+name does not alter or destroy the value it was bound to, and the value will
245
+continue to exist until it goes out of scope, even if it is no longer accessible
246
+by any means.
247
248
```rust
249
let mut x: i32 = 1;
0 commit comments