42f8a3366a
If a do-block body has the wrong type, or a for-loop body has a non-() type, suggest that the user might have meant the other one. Closes #2817 r=brson
16 lines
501 B
Rust
16 lines
501 B
Rust
fn not_bool(f: fn(int) -> ~str) {}
|
|
|
|
fn main() {
|
|
for uint::range(0, 100000) |_i| { //~ ERROR A for-loop body must return (), but
|
|
false
|
|
};
|
|
for not_bool |_i| { //~ ERROR a `loop` function's last argument should return `bool`
|
|
//~^ ERROR A for-loop body must return (), but
|
|
~"hi"
|
|
};
|
|
for uint::range(0, 100000) |_i| { //~ ERROR A for-loop body must return (), but
|
|
~"hi"
|
|
};
|
|
for not_bool() |_i| { //~ ERROR a `loop` function's last argument
|
|
};
|
|
} |