mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
![]() 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](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=d1b0a5d1f01882f9c89c2194a75eb19f)). After this PR, we only mark the RHS as a terminating scope if it is not a `let` expression. |
||
---|---|---|
.. | ||
astconv | ||
check | ||
coherence | ||
collect | ||
impl_wf_check | ||
outlives | ||
structured_errors | ||
variance | ||
bounds.rs | ||
check_unused.rs | ||
collect.rs | ||
constrained_generic_params.rs | ||
errors.rs | ||
expr_use_visitor.rs | ||
hir_wf_check.rs | ||
impl_wf_check.rs | ||
lib.rs | ||
mem_categorization.rs | ||
structured_errors.rs |