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

Internal compiler error with &[[bool]] #27482

Closed
1kasu opened this issue Aug 3, 2015 · 4 comments
Closed

Internal compiler error with &[[bool]] #27482

1kasu opened this issue Aug 3, 2015 · 4 comments

Comments

@1kasu
Copy link

1kasu commented Aug 3, 2015

Hi!
When I was writing my own version of Game of Life, I made new function which caused message:

C:\Users\User\projects\testi2>cargo build
   Compiling testi2 v0.1.0 (file:///C:/Users/User/projects/testi2)
... some warnings...
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'assertion failed: slice_layout_is_correct(cx, &member_llvm_types[..], element_type)', C:/bot/slave/stable-dist-rustc-win-gnu-64/build/src/librustc_trans\trans\debuginfo\metadata.rs:579

Could not compile `testi2`.

To learn more, run the command again with --verbose.

This happens only with cargo build, but with rustc it's fine.
I noticed that following program is enough to cause that:

fn main() {
    println!("Hello, world!");
}

fn laske_ymparisto(taulukko: &[[bool]]) -> i32{
    6
}

My rust version:
rustc 1.1.0 (35ceea3 2015-06-19)
binary: rustc
commit-hash: 35ceea3
commit-date: 2015-06-19
host: x86_64-pc-windows-gnu
release: 1.1.0

I would like to know if anyone else gets this kind of problem or is it just me.

@Aatch
Copy link
Contributor

Aatch commented Aug 3, 2015

Hmm, that &[[bool]] type should be an error, as slices can only contain Sized types. You can't construct one though. I don't know why it would fail specifically when using Cargo by not rustc. Can you run cargo build --verbose and post the output?

@1kasu
Copy link
Author

1kasu commented Aug 3, 2015

Here it is with --verbose

C:\Users\User\projects\testi2>cargo build --verbose
Compiling testi2 v0.1.0 (file:///C:/Users/User/projects/testi2)
Running rustc src\main.rs --crate-name testi2 --crate-type bin -g --out-di r C:\Users\User\projects\testi2\target\debug --emit=dep-info,link -L dependency= C:\Users\User\projects\testi2\target\debug -L dependency=C:\Users\User\projects\ testi2\target\debug\deps
src\main.rs:6:1: 8:2 warning: function is never used: laske_ymparisto, #[warn(
dead_code)] on by default
src\main.rs:6 fn laske_ymparisto(taulukko: &[[bool]]) -> i32{
src\main.rs:7 6
src\main.rs:8 }
src\main.rs:6:20: 6:28 warning: unused variable: taulukko, #[warn(unused_varia
bles)] on by default
src\main.rs:6 fn laske_ymparisto(taulukko: &[[bool]]) -> i32{
^~~~~~~~
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/m
aster/CONTRIBUTING.md#bug-reports
note: run with RUST_BACKTRACE=1 for a backtrace
thread 'rustc' panicked at 'assertion failed: slice_layout_is_correct(cx, &membe
r_llvm_types[..], element_type)', C:/bot/slave/stable-dist-rustc-win-gnu-64/buil
d/src/librustc_trans\trans\debuginfo\metadata.rs:579

Could not compile testi2.

Caused by:
Process didn't exit successfully: rustc src\main.rs --crate-name testi2 --cra te-type bin -g --out-dir C:\Users\User\projects\testi2\target\debug --emit=dep-i nfo,link -L dependency=C:\Users\User\projects\testi2\target\debug -L dependency= C:\Users\User\projects\testi2\target\debug\deps (exit code: 101)

@Stebalien
Copy link
Contributor

Almost definitely this: #24707

@Aatch
Copy link
Contributor

Aatch commented Aug 3, 2015

Agreed, the "debuginfo" comment seals it for me, as it explains the difference between using cargo and using rustc.

Closing as duplicate of #24707

@Aatch Aatch closed this as completed Aug 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants