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
typeCb<'self> = 'self |buf:&[u8]| -> bool;// type Cb = proc(&[u8]) -> bool; // Works with this.fnbug(cb:Cb) -> bool{let arg = "hello";cb(arg.as_bytes())}fnmain(){
do bug |s| {true};}
Rust output this:
rustc -o bug bug.rs
bug.rs:12:7: 14:5 error: last argument in `do` call has non-procedure type: |&[u8]| -> bool
bug.rs:12 do bug |s| {
bug.rs:13 true
bug.rs:14 };
task 'rustc' failed at 'assertion failed: !ty::type_needs_infer(ty)', /build/rust-git/src/rust/src/librustc/middle/typeck/mod.rs:241
error: internal compiler error: unexpected failure
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
task '<main>' failed at 'explicit failure', /build/rust-git/src/rust/src/librustc/lib.rs:395
Makefile:6: recipe for target 'bug' failed
make: *** [bug] Error 101
This seems to me to be a lack of type checking, but I'm not sure.
PS: I'm using latest nightly Rust build from thestinger Arch repo.
The text was updated successfully, but these errors were encountered:
Yep I already know that, I posted this issue because of the ICE, not because the error message ;)
Even if the dev did a mistake, the compiler should not crash :)
When I compile this:
Rust output this:
This seems to me to be a lack of type checking, but I'm not sure.
PS: I'm using latest nightly Rust build from thestinger Arch repo.
The text was updated successfully, but these errors were encountered: