]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2294-if-let-guard/typeck.rs
Add a few basic tests for if-let guards
[rust.git] / src / test / ui / rfc-2294-if-let-guard / typeck.rs
1 #![feature(if_let_guard)]
2 #![allow(incomplete_features)]
3
4 fn ok() -> Result<Option<bool>, ()> {
5     Ok(Some(true))
6 }
7
8 fn main() {
9     match ok() {
10         Ok(x) if let Err(_) = x => {},
11         //~^ ERROR mismatched types
12         Ok(x) if let 0 = x => {},
13         //~^ ERROR mismatched types
14         _ => {}
15     }
16 }