mirror of
https://github.com/Noratrieb/evaluate_obligation-fingerprints.git
synced 2026-01-15 10:45:01 +01:00
50 lines
No EOL
824 B
Rust
50 lines
No EOL
824 B
Rust
use std::{
|
|
pin::Pin,
|
|
task::{Context, Poll},
|
|
};
|
|
|
|
trait FnOnce1 {
|
|
type Output;
|
|
}
|
|
|
|
impl<T, R> FnOnce1 for T
|
|
where
|
|
T: FnOnce() -> R,
|
|
{
|
|
type Output = R;
|
|
}
|
|
struct Map<F>(F);
|
|
|
|
impl<F, T> Future for Map<F>
|
|
where
|
|
F: FnOnce1<Output = T>,
|
|
{
|
|
type Output = T;
|
|
|
|
fn poll(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<T> {
|
|
loop {}
|
|
}
|
|
}
|
|
|
|
fn take_output<Fut: Future>(_: Pin<&mut Fut>) -> Fut::Output {
|
|
loop {}
|
|
}
|
|
|
|
fn main() {
|
|
let mut bazz = Map(async || ());
|
|
let mut barr = async { Bazz {} };
|
|
|
|
let mut _fut0 = unsafe { Pin::new_unchecked(&mut bazz) };
|
|
let mut _fut1 = unsafe { Pin::new_unchecked(&mut barr) };
|
|
|| {
|
|
take_output(_fut0.as_mut());
|
|
take_output(_fut1.as_mut());
|
|
};
|
|
}
|
|
|
|
// 1
|
|
// 2
|
|
|
|
#[derive(proc_macro_thing::MyMacro)]
|
|
#[helper]
|
|
struct Bazz {} |