about summary refs log tree commit diff
path: root/tests/ui/type-alias-impl-trait/static-lifetime-through-closure-issue-122775.rs
blob: 1bb0acf9b754e1ef6df1620404aabe2c6f486401 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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() {}