Closed
Description
Context: #2735
I added a special-case to trans for let _ = e;
where e
has a destructor, so this gets treated the same way as e;
. However, @nikomatsakis points out that this isn't an entirely satisfactory solution, because for consistency, we'd also want to drop the RHS of the tuple in let (x, _) = e;
early, or indeed, any sub-component of a data structure that's bound to a pattern with a deeply-nested _
in the corresponding position.
Since we don't have a semantics for when destructors run, it's a little hard to say what the right thing is, but whatever we do should be consistent.