about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/errors.rs
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-10-19 14:05:52 +0530
committerGitHub <noreply@github.com>2022-10-19 14:05:52 +0530
commit48c5e0c262c4b454ec1c4528b5a9d81d3fc6bde6 (patch)
treee08004f9f2b1021ca95997f0ce432656f06ddf5f /compiler/rustc_interface/src/errors.rs
parent5c2c476ad17b7cf4c883dedd3802b5b8a9d1b8f3 (diff)
parent3041bc9e71355eea71a5070b7939439fd3cf7e01 (diff)
downloadrust-48c5e0c262c4b454ec1c4528b5a9d81d3fc6bde6.tar.gz
rust-48c5e0c262c4b454ec1c4528b5a9d81d3fc6bde6.zip
Rollup merge of #103034 - nathanwhit:let-chains-rhs-temporaries, r=wesleywiser
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.
Diffstat (limited to 'compiler/rustc_interface/src/errors.rs')
0 files changed, 0 insertions, 0 deletions