-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
ICE: should be sized but is not?
#122581
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
matthiaskrgr
added
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.
C-bug
Category: This is a bug.
labels
Mar 16, 2024
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Mar 16, 2024
This is incidentally fixed by #122493 by making unions always sized. |
smaller: union Union {
val: [u8],
}
fn cast(ptr: *const ()) -> *const Union {
ptr as _
} The union is currently in fact not sized, but this code assumes that non-struct ADTs must be sized: rust/compiler/rustc_hir_typeck/src/cast.rs Lines 101 to 144 in 7aa1de7
|
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 19, 2024
…test, r=compiler-errors add test for casting pointer to union with unsized tail closes rust-lang#122581
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 19, 2024
Rollup merge of rust-lang#122724 - lukas-code:unsized-union-cast-ice-test, r=compiler-errors add test for casting pointer to union with unsized tail closes rust-lang#122581
jieyouxu
removed
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Mar 21, 2024
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.
auto-reduced (treereduce-rust):
original:
Version information
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
The text was updated successfully, but these errors were encountered: