SHARE
TWEET

Untitled

a guest May 22nd, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use std::rc::Rc;
  2.  
  3. #[derive(Debug)]
  4. struct Foo {
  5.     a: Rc<u32>,
  6.     b: Rc<u32>,
  7. }
  8.  
  9. impl Foo {
  10.     fn new() -> Self {
  11.         let a = Rc::new(123);
  12.         Foo { a: a.clone(), b: a.clone() }
  13.     }
  14. }
  15.  
  16. fn main() {
  17.     let foo = Foo::new();
  18.     println!("{}", foo.b);
  19. }
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