about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/example/std_example.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-03-02 16:53:16 +0100
committerGitHub <noreply@github.com>2024-03-02 16:53:16 +0100
commit7bacfced9523407af772d9de5fc87435b90a5be5 (patch)
tree8980b7994723e57f97c5af018acf6195fd418852 /compiler/rustc_codegen_gcc/example/std_example.rs
parent5b66e008e09061c585079f11bfc8785fa3cfaa00 (diff)
parent972d8daf47d8a61e00304e1e362b32ca380ce947 (diff)
downloadrust-7bacfced9523407af772d9de5fc87435b90a5be5.tar.gz
rust-7bacfced9523407af772d9de5fc87435b90a5be5.zip
Rollup merge of #121892 - Zalathar:expr-kind-let, r=Nadrieril
The ordinary lowering of `thir::ExprKind::Let` is unreachable

After desugaring, `let` expressions should only appear inside `if` expressions or `match` guards, possibly nested within a let-chain. In both cases they are specifically handled by the lowerings of those expressions, so this case is currently unreachable.

---

Context: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Lowering.20of.20.60thir.3A.3AExprKind.3A.3ALet.60.20is.20unreachable

My conclusions are partly based on the observation that stubbing out this match arm doesn't cause any test failures. So either this really is unreachable, or it can be reached in some obscure circumstances that our test suite doesn't cover.

If we end up needing this code (or something like it) for an implementation of https://github.com/rust-lang/rfcs/pull/3573, it should be easy enough to pull it back out of version control history.

I looked into having the `if`/`match` lowerings call back into `expr_into_dest`, but from what I can tell that won't work well, because there are extra scoping considerations that require some awareness of the enclosing if/match.

r? ```@Nadrieril```
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/std_example.rs')
0 files changed, 0 insertions, 0 deletions