Skip to content

Commit

Permalink
add 3 ices
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Jul 31, 2022
1 parent 19617cc commit 55cef5d
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
25 changes: 25 additions & 0 deletions ices/99866.rs
Original file line number Diff line number Diff line change
@@ -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: <Back as Backend>::DescriptorSetLayout,
}

impl HalSetLayouts {
pub fn iter<DSL>(self) -> DSL
where
Back: Backend<DescriptorSetLayout = DSL>,
{
self.vertex_layout
}
}

10 changes: 10 additions & 0 deletions ices/99914.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
struct Error;

fn foo() {
let initial_exchange: Result<usize, Error> = todo!();
initial_exchange.and_then(|_|
serve_udp_tunnel()
).await;
}

async fn serve_udp_tunnel() {}
31 changes: 31 additions & 0 deletions ices/99945.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#![feature(type_alias_impl_trait)]

trait Widget<E> {
type State;

fn make_state(&self) -> Self::State;
}

impl<E> Widget<E> for () {
type State = ();

fn make_state(&self) -> Self::State {}
}

struct StatefulWidget<F>(F);

type StateWidget<'a> = impl Widget<&'a ()>;

impl<F: for<'a> Fn(&'a ()) -> StateWidget<'a>> Widget<()> for StatefulWidget<F> {
type State = ();

fn make_state(&self) -> Self::State {}
}

fn new_stateful_widget<F: for<'a> Fn(&'a ()) -> StateWidget<'a>>(build: F) -> impl Widget<()> {
StatefulWidget(build)
}

fn main() {
new_stateful_widget(|_| ()).make_state();
}

0 comments on commit 55cef5d

Please sign in to comment.