rust/src/test/compile-fail/issue-3044.rs
Tim Chevalier c2bb2f0837 When checking loop bodies and do-expr bodies, don't require the expected type to exist
If the expected type is none (due to a type error), we shouldn't fail with an ICE, but
rather, just print out another type error. Changed the do-expr type error message to
make sense in this context (see the test case for how it works).

Closes #3044.
2012-08-02 21:44:14 -07:00

10 lines
369 B
Rust

// error-pattern: Non-function passed to a `do` function as its last argument, or wrong number of arguments passed to a `do` function
fn main() {
let needlesArr: ~[char] = ~['a', 'f'];
do vec::foldr(needlesArr) |x, y| {
}
// for some reason if I use the new error syntax for the two error messages this generates,
// the test runner gets confused -- tjc
}