You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Hello.
Trying to learn Rust, playing with closures. Compiler asked me to report bug.
Code:
Error:
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 :)
The text was updated successfully, but these errors were encountered: