SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. struct X<'a> {
  2.     v: &'a mut u32,
  3. }
  4.  
  5. fn v<'a>(x: &'a mut X<'a>) -> &'a mut u32 { x.v }
  6.  
  7. fn b<'a>(x: &'a mut X<'a>) -> u32 {
  8.     let u = *v(x);
  9.     let v = *v(x);
  10.     u + v
  11. }
  12.  
  13. fn main() {
  14.     let mut x = 0;
  15.     b(&mut X { v: &mut x });
  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