-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check_validity_requirement
(called from clippy) throws an ICE for std::cell::UnsafeCell
#119620
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
m-rph
added
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Jan 5, 2024
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Jan 5, 2024
Can you run this on a debug-assertion-enabled version of the compiler with |
Hopefully I got this right. This is from master trace and layout (?)
I have attached a patch that produces this stderr in |
saethlin
removed
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Jan 7, 2024
This was referenced Aug 2, 2024
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Aug 7, 2024
Rollup merge of rust-lang#128720 - y21:issue119620, r=compiler-errors Pass the right `ParamEnv` to `might_permit_raw_init_strict` Fixes rust-lang#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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Hi, I began investigating this piece of code that causes an ICE in clippy (rust-lang/rust-clippy#12032). I triaged the issue to
check_validity_requirement
getting called with:where
cx.param_env.and(ty)
evaluates toThe code that causes this is this
Code
when we try to check for
clippy::uninit_vec
.Meta
I was able to reproduce this in nightly and stable.
Error output
Backtrace from playground:
The text was updated successfully, but these errors were encountered: