The point about "does not alter or destroy the value" is referring only to the immediate act of shadowing. You can't access the shadowed variable by name anymore, but it will still be destroyed at the end of its scope as normal.
cuviper
2
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
|
Variable Shadowing
|
3 | 3245 | July 28, 2019 | |
| [solved] Does shadowing involve keeping unuseful data in memory until the end of the block? [Rust fundamentals] | 4 | 587 | January 26, 2019 | |
|
A few questions on shadowing and the let keyword
|
10 | 971 | April 28, 2024 | |
|
Inquiring about idiomatic usage of shadowing
|
7 | 4042 | July 1, 2016 | |
| Ownership of shadowing | 13 | 1071 | August 10, 2021 |