Double-free error when using std::ptr::read in Rust

i am trying to read a value from pointer but i always get a double-free error. Do you guys know a way to fix it? I am using mem::forget to block the free operation but i still get the same result. use std::ptr; use std::mem; fn main() { let test = String::from("hello!"); println!("{}", get_value_from_ptr(&test)); println!("{}",… Read More Double-free error when using std::ptr::read in Rust