Skip to content

note: the compiler unexpectedly panicked. this is a bug. #25877

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

Closed
emabee opened this issue May 29, 2015 · 4 comments
Closed

note: the compiler unexpectedly panicked. this is a bug. #25877

emabee opened this issue May 29, 2015 · 4 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@emabee
Copy link

emabee commented May 29, 2015

fn main() {
    let mut a = [0;10];
    a[5] = 5;

    let slice = & a[4..7];
    for i in 0..3 {
        println!("slice[{0}]:{1}",i,slice[i]);
    } 

    take(a);

    for i in 0..10 {
        println!("a[{0}]:{1}",i,a[i]);
    }

}


fn take (a [i32]){
//
}
@jdm jdm added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label May 29, 2015
@oli-obk
Copy link
Contributor

oli-obk commented May 29, 2015

I cannot reproduce the ICE on nightly or stable, please provide the error message and compiler-version. Also your example is missing a : between the a and the [i32] of the take function

@emabee
Copy link
Author

emabee commented May 29, 2015

$ rustc --version
rustc 1.0.0-beta (9854143 2015-04-02) (built 2015-04-02)

$ cargo run
Compiling test v0.0.1 (file:///C:/dev/rust/projects/test)
src\main.rs:19:10: 19:11 error: internal compiler error: ident only path should have been covered already
src\main.rs:19 fn take (a [i32]){
^
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 'Box', C:/bot/slave/beta-dist-rustc-win-64/build/src/libsyntax\diagnostic.rs:130

Could not compile test.

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

Also your example is missing a : between the a and the [i32] of the take function
Sure. But if I add it, rustc doesn't panic anymore. I'm just running through the tutorials, and am wildly trying things out. :-)

@oli-obk
Copy link
Contributor

oli-obk commented May 29, 2015

please update your rust compiler. I believe this has been fixed in #22544

@alexcrichton
Copy link
Member

Confirmed that this is fixed on stable and beyond, but thanks for the report!

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

No branches or pull requests

4 participants