rust/tests/ui/expr/if/if-let-arm-types.rs

12 lines
284 B
Rust

fn main() {
if let Some(b) = None {
//~^ NOTE `if` and `else` have incompatible types
()
//~^ NOTE expected because of this
} else {
1
};
//~^^ ERROR: `if` and `else` have incompatible types
//~| NOTE expected `()`, found integer
}