From ebf574fb97e8a771972ba5866bf395ecce3d14be Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sat, 11 May 2024 12:57:29 +0200 Subject: [PATCH] Add test for #122775 --- ...tic-lifetime-through-closure-issue-122775.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/ui/type-alias-impl-trait/static-lifetime-through-closure-issue-122775.rs diff --git a/tests/ui/type-alias-impl-trait/static-lifetime-through-closure-issue-122775.rs b/tests/ui/type-alias-impl-trait/static-lifetime-through-closure-issue-122775.rs new file mode 100644 index 0000000000000..1bb0acf9b754e --- /dev/null +++ b/tests/ui/type-alias-impl-trait/static-lifetime-through-closure-issue-122775.rs @@ -0,0 +1,17 @@ +//@ check-pass + +#![feature(type_alias_impl_trait)] + +fn spawn(future: F) -> impl Sized +where + F: FnOnce() -> T, +{ + future +} + +fn spawn_task(sender: &'static ()) -> impl Sized { + type Tait = impl Sized + 'static; + spawn::(move || sender) +} + +fn main() {}