diff options
| author | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2024-05-11 12:57:29 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2024-05-11 12:59:06 +0200 |
| commit | ebf574fb97e8a771972ba5866bf395ecce3d14be (patch) | |
| tree | 43c44bf1c5189791ef3b0c315340f007009865a5 | |
| parent | be7549f82c194c7a5dc8f34ed0541bfebbaf33ea (diff) | |
Add test for #122775
| -rw-r--r-- | tests/ui/type-alias-impl-trait/static-lifetime-through-closure-issue-122775.rs | 17 |
1 files changed, 17 insertions, 0 deletions
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 00000000000..1bb0acf9b75 --- /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<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() {} |
