2023-06-07 15:00:56 -05:00
|
|
|
#![no_std]
|
|
|
|
|
2023-06-28 10:05:17 -05:00
|
|
|
use core::future::Future;
|
|
|
|
|
|
|
|
pub struct NeedsDrop;
|
|
|
|
|
|
|
|
impl Drop for NeedsDrop {
|
|
|
|
fn drop(&mut self) {}
|
|
|
|
}
|
|
|
|
|
2023-06-07 15:00:56 -05:00
|
|
|
#[panic_handler]
|
|
|
|
fn handler(_: &core::panic::PanicInfo<'_>) -> ! {
|
|
|
|
loop {}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub unsafe fn oops(x: *const u32) -> u32 {
|
|
|
|
*x
|
|
|
|
}
|
2023-06-28 10:05:17 -05:00
|
|
|
|
|
|
|
pub async fn foo(_: NeedsDrop) {
|
|
|
|
async fn bar() {}
|
|
|
|
bar().await;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn poll_foo(x: &mut core::task::Context<'_>) {
|
|
|
|
let _g = NeedsDrop;
|
|
|
|
let mut p = core::pin::pin!(foo(NeedsDrop));
|
|
|
|
let _ = p.as_mut().poll(x);
|
|
|
|
let _ = p.as_mut().poll(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn drop_foo() {
|
|
|
|
drop(foo(NeedsDrop));
|
|
|
|
}
|