about summary refs log tree commit diff
path: root/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-12 08:49:02 +0000
committerbors <bors@rust-lang.org>2023-06-12 08:49:02 +0000
commitdcd31550e2d927b2a6bde4d9f4395d9db3c16f71 (patch)
tree84f1b5c710163ba80ef2005ffea930320cb9fd00 /tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff
parent38c47dfe3037e70272c17a7885ee7383e16a9b16 (diff)
parenta4695788caa4370136d3df38f9f20d0bb12060fa (diff)
downloadrust-dcd31550e2d927b2a6bde4d9f4395d9db3c16f71.tar.gz
rust-dcd31550e2d927b2a6bde4d9f4395d9db3c16f71.zip
Auto merge of #14932 - HKalbasi:dev, r=HKalbasi
Lower const params with a bad id

cc #7434

This PR adds an `InTypeConstId` which is a `DefWithBodyId` and lower const generic parameters into bodies using it, and evaluate them with the mir interpreter. I think this is the last unimplemented const generic feature relative to rustc stable.

But there is a problem: The id used in the `InTypeConstId` is the raw `FileAstId`, which changes frequently. So these ids and their bodies will be invalidated very frequently, which is bad for incremental analysis.

Due this problem, I disabled lowering for local crates (in library crate the id is stable since files won't be changed). This might be overreacting (const generic expressions are usually small, maybe it would be better enabled with bad performance than disabled) but it makes motivation for doing it in the correct way, and it splits the potential panic and breakages that usually comes with const generic PRs in two steps.

Other than the id, I think (at least I hope) other parts are in the right direction.
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff')
0 files changed, 0 insertions, 0 deletions