about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-08-06 20:23:41 +0200
committerGitHub <noreply@github.com>2024-08-06 20:23:41 +0200
commit8912318a4cdf64d8c0186665d54897cb49eb4c8a (patch)
tree7955a22309520b4c32bb8c25d9a9e717b5fe26f8 /compiler/rustc_codegen_llvm/src
parent4b29f42ffc2104a74a3e6572d36adfe309e45dbd (diff)
parentfdf3b31165be835879220cfea1cc6a2112452bf6 (diff)
downloadrust-8912318a4cdf64d8c0186665d54897cb49eb4c8a.tar.gz
rust-8912318a4cdf64d8c0186665d54897cb49eb4c8a.zip
Rollup merge of #128720 - y21:issue119620, r=compiler-errors
Pass the right `ParamEnv` to `might_permit_raw_init_strict`

Fixes #119620

`might_permit_raw_init_strict` currently passes an empty `ParamEnv` to the `InterpCx`, instead of the actual `ParamEnv` that was passed in to `check_validity_requirement` at callsite.

This leads to ICEs such as the linked issue where for `UnsafeCell<*mut T>` we initially get the layout with the right `ParamEnv` (which suceeds because it can prove that `T: Sized` and therefore `UnsafeCell<*mut T>` has a known layout) but then do the rest with an empty `ParamEnv` where `T: Sized` is not known to hold so getting the layout for `*mut T` later fails.

This runs into an assertion in other layout code where it's making the (valid) assumption that, when we already have a layout for a struct (`UnsafeCell<*mut T>`), getting the layout of one of its fields (`*mut T`) should also succeed, which wasn't the case here due to using the wrong `ParamEnv`.

So, this PR changes it to just use the same `ParamEnv` all the way throughout.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions