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.
2 parents 814f685 + f07aa35 commit 3ff22ccCopy full SHA for 3ff22cc
src/doc/book/variable-bindings.md
@@ -241,7 +241,10 @@ println!("{}", x); // Prints "42"
241
Shadowing and mutable bindings may appear as two sides of the same coin, but
242
they are two distinct concepts that can't always be used interchangeably. For
243
one, shadowing enables us to rebind a name to a value of a different type. It
244
-is also possible to change the mutability of a binding.
+is also possible to change the mutability of a binding. Note that shadowing a
245
+name does not alter or destroy the value it was bound to, and the value will
246
+continue to exist until it goes out of scope, even if it is no longer accessible
247
+by any means.
248
249
```rust
250
let mut x: i32 = 1;
0 commit comments