2024-06-27 18:54:28 -05:00
|
|
|
//@ compile-flags: -Zinline-mir=yes --crate-type=lib
|
2024-06-28 09:18:13 -05:00
|
|
|
//@ build-pass
|
2024-06-27 18:54:28 -05:00
|
|
|
|
|
|
|
use std::mem::ManuallyDrop;
|
|
|
|
|
|
|
|
pub struct Foo<T, const N: usize>([T; N]);
|
|
|
|
|
|
|
|
pub struct Dorp {}
|
|
|
|
|
|
|
|
impl Drop for Dorp {
|
|
|
|
fn drop(&mut self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[inline]
|
|
|
|
// SAFETY: call this with a valid allocation idk
|
|
|
|
pub unsafe fn drop<const M: usize>(x: *mut Foo<Dorp, M>) {
|
|
|
|
std::ptr::drop_in_place(x);
|
|
|
|
}
|