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.
5 lines
181 B
Rust
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`
|
|
}
|