No, it doesn't - that's not how _
works. let _ = <expr>;
is exactly equivalent to <expr>;
. There are some value category things going on here. I'd recommend trying out the following examples, to get more intuition:
struct D(i32);
impl Drop for D {
fn drop(&mut self) { println!("dropped {}", self.0); }
}
fn main() {
{
D(0);
let x = D(1);
let _ = D(2);
D(3);
let y = D(4);
let _ = D(5);
}
{
let var = D(0);
let _ = var;
var;
D(1);
}
}
I don't really feel like explaining what's going on here with the value categories, because that would require synthesis of difficult wording on my part. However, if you know C++, the rules are similar.