about summary refs log tree commit diff
path: root/compiler/rustc
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-09-25 20:31:52 +1000
committerGitHub <noreply@github.com>2025-09-25 20:31:52 +1000
commit21b0e12e0140604150e5a2d4cf93fe2cac8f552f (patch)
treebdfe395a169999271d6aecbf12d8c59db207469b /compiler/rustc
parent2acd80cfa928c1371d2c60149b3febe66c9e6637 (diff)
parentb77de834c031890c048f8164d4b5979d2511c00e (diff)
downloadrust-21b0e12e0140604150e5a2d4cf93fe2cac8f552f.tar.gz
rust-21b0e12e0140604150e5a2d4cf93fe2cac8f552f.zip
Rollup merge of #145277 - dingxiangfei2009:fold-coercion-into-const, r=nnethercote
Do not materialise X in [X; 0] when X is unsizing a const

Fix rust-lang/rust#143671

It turns out that MIR builder materialise `X` in `[X; 0]` into a temporary local when `X` is unsizing a `const`. This led to a confusing call to destructor of `X` when such a destructor is declared. [Playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=8dfc933af89efeb89c881bc77498ba63)

This patch may miss out other cases that we should avoid materialisation in case of `[X; 0]`. Suggestions to include is most welcome!
Diffstat (limited to 'compiler/rustc')
0 files changed, 0 insertions, 0 deletions