SHARE
TWEET

Untitled

a guest Aug 20th, 2019 58 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top