From 55cef5d6112c97e5468c954edc726dfeba105567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sun, 31 Jul 2022 09:55:43 +0200 Subject: [PATCH] add 3 ices https://github.com/rust-lang/rust/issues/99866 https://github.com/rust-lang/rust/issues/99914 https://github.com/rust-lang/rust/issues/99945 --- ices/99866.rs | 25 +++++++++++++++++++++++++ ices/99914.rs | 10 ++++++++++ ices/99945.rs | 31 +++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 ices/99866.rs create mode 100644 ices/99914.rs create mode 100644 ices/99945.rs diff --git a/ices/99866.rs b/ices/99866.rs new file mode 100644 index 00000000..9a94c6fe --- /dev/null +++ b/ices/99866.rs @@ -0,0 +1,25 @@ +#![crate_type = "lib"] + +pub trait Backend { + type DescriptorSetLayout; +} + +pub struct Back; + +impl Backend for Back { + type DescriptorSetLayout = u32; +} + +pub struct HalSetLayouts { + vertex_layout: ::DescriptorSetLayout, +} + +impl HalSetLayouts { + pub fn iter(self) -> DSL + where + Back: Backend, + { + self.vertex_layout + } +} + diff --git a/ices/99914.rs b/ices/99914.rs new file mode 100644 index 00000000..94b2715f --- /dev/null +++ b/ices/99914.rs @@ -0,0 +1,10 @@ +struct Error; + +fn foo() { + let initial_exchange: Result = todo!(); + initial_exchange.and_then(|_| + serve_udp_tunnel() + ).await; +} + +async fn serve_udp_tunnel() {} diff --git a/ices/99945.rs b/ices/99945.rs new file mode 100644 index 00000000..513881b7 --- /dev/null +++ b/ices/99945.rs @@ -0,0 +1,31 @@ +#![feature(type_alias_impl_trait)] + +trait Widget { + type State; + + fn make_state(&self) -> Self::State; +} + +impl Widget for () { + type State = (); + + fn make_state(&self) -> Self::State {} +} + +struct StatefulWidget(F); + +type StateWidget<'a> = impl Widget<&'a ()>; + +impl Fn(&'a ()) -> StateWidget<'a>> Widget<()> for StatefulWidget { + type State = (); + + fn make_state(&self) -> Self::State {} +} + +fn new_stateful_widget Fn(&'a ()) -> StateWidget<'a>>(build: F) -> impl Widget<()> { + StatefulWidget(build) +} + +fn main() { + new_stateful_widget(|_| ()).make_state(); +}