1 2 3 4 5 6 7 8 9 10
use std::mem; use std::cell::UnsafeCell; use std::rc::Rc; use priv_traits::*; pub unsafe fn transform_sink_lifetime<'a,'b,T,S:SinkInner<'b,T>>(st: Rc<UnsafeCell<S>>) -> Rc<UnsafeCell<dyn SinkInner<'a, T>>>{ let st: Rc<UnsafeCell<dyn SinkInner<'b,T>>> = st.clone(); mem::transmute(st) }