mirror of
https://github.com/Noratrieb/evaluate_obligation-fingerprints.git
synced 2026-01-16 03:05:02 +01:00
init
This commit is contained in:
commit
93553d8aae
10 changed files with 218 additions and 0 deletions
62
src/main.rs
Normal file
62
src/main.rs
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
use futures_util::future::{Map, MapOk};
|
||||
use std::pin::Pin;
|
||||
|
||||
struct MapOk2<Fut, F>(Fut, F);
|
||||
impl<Fut, F> Future for MapOk2<Fut, F>
|
||||
where
|
||||
Map<Fut, F>: Future,
|
||||
{
|
||||
type Output = <Map<Fut, F> as Future>::Output;
|
||||
fn poll(
|
||||
self: Pin<&mut Self>,
|
||||
cx: &mut std::task::Context<'_>,
|
||||
) -> std::task::Poll<Self::Output> {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct MaybeDone<Fut: Future>(Fut);
|
||||
|
||||
pub fn take_output<Fut: Future>(x: Pin<&mut MaybeDone<Fut>>) -> Fut::Output {
|
||||
loop {}
|
||||
}
|
||||
|
||||
struct AndThen<Fut1, F>(Fut1, F);
|
||||
impl<Fut1, F> Future for AndThen<Fut1, F>
|
||||
where
|
||||
MapOk<Fut1, F>: Future,
|
||||
{
|
||||
type Output = ();
|
||||
fn poll(
|
||||
self: Pin<&mut Self>,
|
||||
cx: &mut std::task::Context<'_>,
|
||||
) -> std::task::Poll<Self::Output> {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
|
||||
fn and_then<This, F>(s: This, f: F) -> AndThen<This, F> {
|
||||
loop {}
|
||||
}
|
||||
|
||||
pub async fn bar_baz() {
|
||||
let bazz = and_then(async { Ok::<(), ()>(()) }, async |_| Ok::<(), ()>(()));
|
||||
let barr = async { Bazz {} };
|
||||
|
||||
let mut _fut0 = MaybeDone(bazz);
|
||||
let mut _fut0 = unsafe { std::pin::Pin::new_unchecked(&mut _fut0) };
|
||||
let mut _fut1 = MaybeDone(barr);
|
||||
let mut _fut1 = unsafe { std::pin::Pin::new_unchecked(&mut _fut1) };
|
||||
std::future::poll_fn(move |__cx: &mut std::task::Context<'_>| {
|
||||
std::task::Poll::Ready((take_output(_fut0.as_mut()), take_output(_fut1.as_mut())))
|
||||
});
|
||||
}
|
||||
|
||||
// 1
|
||||
// 2
|
||||
|
||||
#[derive(proc_macro_thing::MyMacro)]
|
||||
#[helper]
|
||||
pub struct Bazz {}
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue