blob: 1c675788ee93318a0ef1378190c2766697ba8836 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// check-pass
// compile-flags: -Z validate-mir
#![feature(let_chains)]
fn lambda<T, U>() -> U
where
T: Default,
U: Default,
{
let foo: Result<T, ()> = Ok(T::default());
let baz: U = U::default();
if let Ok(foo) = foo && let Ok(bar) = transform(foo) {
bar
} else {
baz
}
}
fn transform<T, U>(input: T) -> Result<U, ()> {
todo!()
}
fn main() {}
|