Guest User

Untitled

a guest
Sep 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #![feature(nll)]
  2.  
  3. #[derive(Debug)]
  4. struct A<'a> {
  5. name: &'a str
  6. }
  7.  
  8. #[derive(Debug)]
  9. struct B<'a> {
  10. a_ref1: &'a mut A<'a>,
  11. a_ref2: &'a mut A<'a>
  12. }
  13.  
  14. fn main() {
  15. let mut a1 = A {
  16. name: "Denis"
  17. };
  18. let mut a2 = A {
  19. name: "Denis"
  20. };
  21. let b = B {
  22. a_ref1: &mut a1,
  23. a_ref2: &mut a2
  24. };
  25. println!("B: {:?}", b);
  26. }
Add Comment
Please, Sign In to add comment