Skip to content
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 when transmuting [T,..1] to T #7988

Closed
brendanzab opened this issue Jul 23, 2013 · 2 comments
Closed

ICE when transmuting [T,..1] to T #7988

brendanzab opened this issue Jul 23, 2013 · 2 comments
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@brendanzab
Copy link
Member

fn main() {
    unsafe { std::cast::transmute::<[int,..1],int>([1]) }
}
rust: task failed at 'option::get none', /rust/src/libstd/option.rs:362
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /rust/src/librustc/rustc.rs:366
rust: domain main @0x7f822300c610 root task failed
@dotdash
Copy link
Contributor

dotdash commented Jul 23, 2013

Yeah, I forgot to make the immediate/non-immediate distinction for the out-type there. Testing a fix now...

dotdash added a commit to dotdash/rust that referenced this issue Jul 23, 2013
The code to build the transmute intrinsic currently makes the invalid
assumption that if the in-type is non-immediate, the out-type is
non-immediate as well. But this is wrong, for example when transmuting
[int, ..1] to int. So we need to handle this fourth case as well.

Fixes rust-lang#7988
flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 23, 2021
…fe_blocks, r=flip1995

Fix ICE on `undocumented_unsafe_blocks`

fix rust-lang/rust-clippy#7979

changelog: Fix ICE on `undocumented_unsafe_blocks`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants