Guest User

Untitled

a guest
Aug 20th, 2019
63
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. struct Test {
  2. x : i32,
  3. }
  4.  
  5. impl Test {
  6. fn new() -> Self {
  7. let t = Test {x : 100};
  8. println!("Address of t: {:p}", &t as *const Test); // cast just for clarity
  9. t
  10. }
  11. }
  12.  
  13. fn main() {
  14. let test = Test::new();
  15. println!("Address of test: {:p}", &test as *const Test); // cast just for clarity
  16. }
RAW Paste Data