2024-02-16 14:02:50 -06:00
|
|
|
//@ check-pass
|
|
|
|
//@ compile-flags: -Z validate-mir
|
2022-09-28 03:45:09 -05:00
|
|
|
#![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() {}
|