Let expressions on RHS shouldn't be terminating scopes
Fixes #100276.
Before this PR, we were unconditionally marking the RHS of short-circuiting binary expressions as a terminating scope.
In the case of a let chain where the let expression was on the RHS, this meant that temporaries within the let expr would only live until the end of the expression. Since this only affected the RHS, this led to surprising behavior (example).
After this PR, we only mark the RHS as a terminating scope if it is not a let expression.
r? @wesleywiser
(rust-highfive has picked a reviewer for you, use r? to override)
Thanks @nathanwhit!
@bors r+
:pushpin: Commit 3041bc9e71355eea71a5070b7939439fd3cf7e01 has been approved by wesleywiser
It is now in the queue for this repository.