1 #![feature(inline_const, const_type_id)]
3 use std::alloc::Layout;
5 use std::mem::transmute;
6 use std::ptr::drop_in_place;
11 drop_in_place: unsafe fn(*mut ()),
15 pub fn new<T>() -> &'static Self {
18 layout: Layout::new::<T>(),
19 type_id: TypeId::of::<T>(),
20 //~^ ERROR the parameter type `T` may not live long enough
21 //~| ERROR the parameter type `T` may not live long enough
22 drop_in_place: unsafe {
23 transmute::<unsafe fn(*mut T), unsafe fn(*mut ())>(drop_in_place::<T>)