What does the `let x = x;` construct mean in Rust and why is it needed?
Hi everyone! I started learning Rust and came across a strange construct in someone else's code:\n\n```rust\nlet x = 5;\nlet x = x;\n```\n\nWhat is this even? Why reassign a variable to itself? Is this some kind of magic or a bug? I tried running this code, and it works, but I don't understand the point.\n\nMaybe it has something to do with mutability? For example, I saw this code:\n\n```rust\nlet mut x = 10;\nlet x = x; // Now x is immutable?\n```\n\nOr is it just a way to "reset" a variable? Please explain for a beginner. I've already read about shadowing, but this is some strange form where the name and value are the same. Does this have any practical use, or is it just redundant code?\n\nThanks in advance!
<<>>
Short answer
The construct