mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
25 lines
398 B
Rust
25 lines
398 B
Rust
|
//@ 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() {}
|