daily pastebin goal
2%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. struct Obj<'a> {
  2.     reference: &'a usize
  3. }
  4.  
  5.  
  6. fn main() {
  7.     let var = 5;
  8.     let mut obj = Obj {
  9.         reference: &var
  10.     };
  11.  
  12.     let ref_to_var = obj.reference;
  13.     let mut_to_obj = &mut obj;
  14.    
  15.     println!("{}", *ref_to_var)
  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