2 #![forbid(incomplete_features, unsafe_code)]
3 #![feature(unsafe_pin_internals)]
4 //~^ ERROR the feature `unsafe_pin_internals` is incomplete and may not be safe to use
6 use core::{marker::PhantomPinned, pin::Pin};
8 /// The `unsafe_pin_internals` is indeed unsound.
9 fn non_unsafe_pin_new_unchecked<T>(pointer: &mut T) -> Pin<&mut T> {
14 let mut self_referential = PhantomPinned;
15 let _: Pin<&mut PhantomPinned> = non_unsafe_pin_new_unchecked(&mut self_referential);
16 core::mem::forget(self_referential); // move and disable drop glue!