rust/compiler/rustc_hir_analysis/src
Dylan DPC 48c5e0c262
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.
2022-10-19 14:05:52 +05:30
..
astconv Change InferCtxtBuilder from enter to build 2022-10-07 07:10:40 -05:00
check Rollup merge of #103034 - nathanwhit:let-chains-rhs-temporaries, r=wesleywiser 2022-10-19 14:05:52 +05:30
coherence Auto merge of #102931 - camsteffen:inline-overlapping-impls, r=cjgillot 2022-10-16 02:05:30 +00:00
collect Auto merge of #102700 - oli-obk:0xDEAD_TAIT, r=compiler-errors 2022-10-13 22:39:05 +00:00
impl_wf_check Fix compiler docs 2022-10-10 18:28:29 +02:00
outlives rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00
structured_errors rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00
variance rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00
bounds.rs rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00
check_unused.rs Refactor rustc lint API 2022-10-01 10:03:06 +00:00
collect.rs add panic_fmt_nounwind for panicing without unwinding, and use it for panic_no_unwind 2022-10-11 22:47:31 +02:00
constrained_generic_params.rs Fix compiler docs 2022-10-10 18:28:29 +02:00
errors.rs find the correct lang item for ranges 2022-10-04 21:02:07 +08:00
expr_use_visitor.rs Make dyn* cast into a coercion 2022-10-14 04:27:01 +00:00
hir_wf_check.rs Rollup merge of #102829 - compiler-errors:rename-impl-item-kind, r=TaKO8Ki 2022-10-10 00:09:42 +09:00
impl_wf_check.rs Report duplicate definition in impls with overlap check. 2022-10-13 16:50:24 +00:00
lib.rs Change InferCtxtBuilder from enter to build 2022-10-07 07:10:40 -05:00
mem_categorization.rs Make dyn* cast into a coercion 2022-10-14 04:27:01 +00:00
structured_errors.rs rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00