I've seen a few other questions and answers stating that let _ = foo()
destroys the result at the end of the statement rather than at scope exit, which is what let _a = foo()
does.
I am unable to find any official description of this, nor any rationale for this syntax.
I'm interested in a few inter-twined things:
- Is there even a mention of it in the official documentation?
- What is the history behind this choice? Is it simply natural fall-out from Rust's binding / destructuring rules? Is it something inherited from another language? Or does it have some other origin?
- Is there some use-case this syntax addresses that could not have been achieved using explicit scoping?