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

Compiler panicked "ident only path should have been covered already" #22647

Closed
e-oz opened this issue Feb 21, 2015 · 1 comment · Fixed by #22720
Closed

Compiler panicked "ident only path should have been covered already" #22647

e-oz opened this issue Feb 21, 2015 · 1 comment · Fixed by #22720
Labels
A-closures Area: Closures (`|…| { … }`) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@e-oz
Copy link

e-oz commented Feb 21, 2015

Hello.
Trying to learn Rust, playing with closures. Compiler asked me to report bug.

Code:

fn main() {
    let caller<F> = |f: F|
    where F: Fn() -> i32
    {
        let x = f();
        println!("Y {}",x);
        return x;
    };

    caller(bar_handler);
}

fn bar_handler() -> i32 {
    println!("zz");
    return 5;
}

Error:

 cargo run RUST_BACKTRACE=1
   Compiling app v0.0.1
src/main.rs:2:6: 2:12 error: internal compiler error: ident only path should have been covered already
src/main.rs:2   let caller<F> = |f: F|
                    ^~~~~~
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<Any>', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:129

File /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libsyntax/diagnostic.rs doesn't exist, folder /Users/rustbuild/ too.

In this code I tried to create closure with function as first argument, but can't yet find how to declare it. But it's offtopic :)

@kmcallister kmcallister added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-closures Area: Closures (`|…| { … }`) labels Feb 22, 2015
@jdm
Copy link
Contributor

jdm commented Feb 22, 2015

Probably the same as #22426 and #22589.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-closures Area: Closures (`|…| { … }`) 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