rust/src/test/compile-fail/issue-2163.rs
Tim Chevalier 734166f41c Print out return type correctly in typestate error message
In the "not all paths return" error message, typestate was printing
the AST type from the fn decl, not the ty::t type. This ended in tears
when the AST return type was "ty_infer". Now it looks up the function node
ID's type and uses util::ppaux::ty_to_str instead.

Closes #2163.
2012-04-20 18:48:08 -07:00

5 lines
181 B
Rust

fn main(s: [str]) {
let a = [];
vec::each(a) { |x| //! ERROR in function `anon`, not all control paths
} //! ERROR see function return type of `bool`
}