SHARE
TWEET

Untitled

a guest Dec 14th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use std::rc::Rc;
  2.  
  3. #[derive(Clone)]
  4. struct Foo {
  5.     foo: Rc<u32>,
  6. }
  7.  
  8. fn main() {
  9.     let bar = Foo { foo: Rc::new(1212121) };
  10.     let bar2 = bar.clone();
  11.    
  12.     println!("Foo ptr {:p} - {:p}", &*bar.foo, &*bar2.foo)
  13. }
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