#![allow(dead_code, deprecated, unused_variables, unused_mut)] use std::cell::UnsafeCell; fn get_shared(ptr: &mut T) -> &UnsafeCell { let t = ptr as *mut T as *const UnsafeCell; unsafe { &*t } } fn main() {}