Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![feature(nll)]
- #[derive(Debug)]
- struct A<'a> {
- name: &'a str
- }
- #[derive(Debug)]
- struct B<'a> {
- a_ref1: &'a mut A<'a>,
- a_ref2: &'a mut A<'a>
- }
- fn main() {
- let mut a1 = A {
- name: "Denis"
- };
- let mut a2 = A {
- name: "Denis"
- };
- let b = B {
- a_ref1: &mut a1,
- a_ref2: &mut a2
- };
- println!("B: {:?}", b);
- }
Add Comment
Please, Sign In to add comment