Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit 5bcf487

Browse files
authored
Merge pull request #1368 from matthiaskrgr/i
add 3 ices
2 parents 32bdefb + 55cef5d commit 5bcf487

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

ices/99866.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#![crate_type = "lib"]
2+
3+
pub trait Backend {
4+
type DescriptorSetLayout;
5+
}
6+
7+
pub struct Back;
8+
9+
impl Backend for Back {
10+
type DescriptorSetLayout = u32;
11+
}
12+
13+
pub struct HalSetLayouts {
14+
vertex_layout: <Back as Backend>::DescriptorSetLayout,
15+
}
16+
17+
impl HalSetLayouts {
18+
pub fn iter<DSL>(self) -> DSL
19+
where
20+
Back: Backend<DescriptorSetLayout = DSL>,
21+
{
22+
self.vertex_layout
23+
}
24+
}
25+

ices/99914.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
struct Error;
2+
3+
fn foo() {
4+
let initial_exchange: Result<usize, Error> = todo!();
5+
initial_exchange.and_then(|_|
6+
serve_udp_tunnel()
7+
).await;
8+
}
9+
10+
async fn serve_udp_tunnel() {}

ices/99945.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#![feature(type_alias_impl_trait)]
2+
3+
trait Widget<E> {
4+
type State;
5+
6+
fn make_state(&self) -> Self::State;
7+
}
8+
9+
impl<E> Widget<E> for () {
10+
type State = ();
11+
12+
fn make_state(&self) -> Self::State {}
13+
}
14+
15+
struct StatefulWidget<F>(F);
16+
17+
type StateWidget<'a> = impl Widget<&'a ()>;
18+
19+
impl<F: for<'a> Fn(&'a ()) -> StateWidget<'a>> Widget<()> for StatefulWidget<F> {
20+
type State = ();
21+
22+
fn make_state(&self) -> Self::State {}
23+
}
24+
25+
fn new_stateful_widget<F: for<'a> Fn(&'a ()) -> StateWidget<'a>>(build: F) -> impl Widget<()> {
26+
StatefulWidget(build)
27+
}
28+
29+
fn main() {
30+
new_stateful_widget(|_| ()).make_state();
31+
}

0 commit comments

Comments
 (0)