Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let a = "foo".to_owned();
- let b = &a as *const String;
- let c = b as *const dyn core::fmt::Debug;
- // let d = c as *const dyn core::fmt::Display;
- let d = unsafe { core::mem::transmute::<_, *const dyn core::fmt::Display>(c) };
- println!("{}", unsafe { &*d });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement