Rollup merge of #125008 - Dirbaio:test-issue-122775, r=compiler-errors

Add test for #122775

Closes #122775
This commit is contained in:
Matthias Krüger 2024-05-11 23:43:26 +02:00 committed by GitHub
commit d2b0555964
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,17 @@
//@ check-pass
#![feature(type_alias_impl_trait)]
fn spawn<T, F>(future: F) -> impl Sized
where
F: FnOnce() -> T,
{
future
}
fn spawn_task(sender: &'static ()) -> impl Sized {
type Tait = impl Sized + 'static;
spawn::<Tait, _>(move || sender)
}
fn main() {}