#![allow(unused_variables)] fn main() { use std::mem; unsafe { let s = String::from("hello"); let mut s = mem::ManuallyDrop::new(s); let ptr = s.as_mut_ptr(); let len = s.len(); let capacity = s.capacity(); let s = String::from_raw_parts(ptr, len, capacity); assert_eq!(String::from("hello"), s); } }