mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-21 20:17:55 +00:00
22 lines
472 B
Rust
22 lines
472 B
Rust
//@ compile-flags: -Zmir-enable-passes=+DataflowConstProp
|
|
//@ edition: 2021
|
|
//@ build-pass
|
|
#![feature(async_drop)]
|
|
#![allow(incomplete_features)]
|
|
|
|
use std::mem::ManuallyDrop;
|
|
use std::{
|
|
future::async_drop_in_place,
|
|
pin::{pin, Pin},
|
|
};
|
|
fn main() {
|
|
a(b)
|
|
}
|
|
fn b() {}
|
|
fn a<C>(d: C) {
|
|
let e = pin!(ManuallyDrop::new(d));
|
|
let f = unsafe { Pin::map_unchecked_mut(e, |g| &mut **g) };
|
|
let h = unsafe { async_drop_in_place(f.get_unchecked_mut()) };
|
|
h;
|
|
}
|