Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Test {
- x : i32,
- }
- impl Test {
- fn new() -> Self {
- let t = Test {x : 100};
- println!("Address of t: {:p}", &t as *const Test); // cast just for clarity
- t
- }
- }
- fn main() {
- let test = Test::new();
- println!("Address of test: {:p}", &test as *const Test); // cast just for clarity
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement