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