about summary refs log tree commit diff
path: root/compiler/rustc_attr_parsing/src
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-08-07 20:49:38 +1000
committerGitHub <noreply@github.com>2025-08-07 20:49:38 +1000
commit4529dd9192b5dccd3416e48f37c0263e55b852c0 (patch)
tree1fe70f093e121623ef5adbac97bf5671f753e322 /compiler/rustc_attr_parsing/src
parentb0fc38a36202e0e07c5770e3bab8169edb3c173e (diff)
parentc6a97d3c5939783c9df5ba876f0cc06d6fd0268c (diff)
downloadrust-4529dd9192b5dccd3416e48f37c0263e55b852c0.tar.gz
rust-4529dd9192b5dccd3416e48f37c0263e55b852c0.zip
Rollup merge of #143028 - dianne:let-else-storage, r=oli-obk,traviscross
emit `StorageLive` and schedule `StorageDead` for `let`-`else`'s bindings after matching

This PR removes special handling of `let`-`else`, so that `StorageLive`s are emitted and `StorageDead`s are scheduled only after pattern-matching has succeeded. This means `StorageDead`s will no longer appear for all of its bindings on the `else` branch (because they're not live yet) and its drops&`StorageDead`s will happen together like they do elsewhere, rather than having all drops first, then all `StorageDead`s.

This fixes rust-lang/rust#142056, and is therefore a breaking change. I believe it'll need a crater run and a T-lang nomination/fcp thereafter. Specifically, this makes drop-checking slightly more restrictive for `let`-`else` to match the behavior of other variable binding forms. An alternative approach could be to change the relative order of drops and `StorageDead`s for other binding forms to make drop-checking more permissive, but making that consistent would be a significantly more involved change.

r? mir
cc `````@dingxiangfei2009`````

`````@rustbot````` label +T-lang +needs-crater
Diffstat (limited to 'compiler/rustc_attr_parsing/src')
0 files changed, 0 insertions, 0 deletions