Skip to content

Commit

Permalink
Add 84073
Browse files Browse the repository at this point in the history
  • Loading branch information
fanninpm committed Apr 16, 2021
1 parent f02ad16 commit 69d53c5
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions ices/84073.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
use std::marker::PhantomData;

pub trait StatefulFuture<S> {}
pub struct Never<T>(PhantomData<T>);
impl<T> StatefulFuture<T> for Never<T> {}

pub struct RaceBuilder<F, S> {
future: F,
_phantom: PhantomData<S>,
}

impl<T, F> RaceBuilder<T, F>
where
F: StatefulFuture<Option<T>>,
{
pub fn when(self) {}
}

pub struct Race<T, R> {
race: R,
_phantom: PhantomData<T>,
}

impl<T, R> Race<T, R>
where
R: Fn(RaceBuilder<T, Never<T>>),
{
pub fn new(race: R) {}
}

fn main() {
Race::new(|race| race.when());
}

0 comments on commit 69d53c5

Please sign in to comment.