#![allow(unused_variables)] #![feature(allocator_api)] fn main() { use std::rc::Rc; use std::alloc::System; let x = Rc::new_in("hello".to_owned(), System); let (x_ptr, _alloc) = Rc::into_raw_with_allocator(x); unsafe { let x = Rc::from_raw_in(x_ptr, System); assert_eq!(&* x, "hello"); } }