rust/tests/ui/expr/if/if-without-else-result.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
205 B
Rust
Raw Normal View History

//@ dont-require-annotations: NOTE
fn main() {
let a = if true { true };
2020-01-05 00:17:46 +00:00
//~^ ERROR `if` may be missing an `else` clause [E0317]
//~| NOTE expected `bool`, found `()`
2014-10-15 01:07:11 +00:00
println!("{}", a);
}