3 struct Foo { a: isize, b: isize }
6 let mut x: Box<_> = Box::new(Foo { a: 1, b: 2 });
7 let (a, b) = (&mut x.a, &mut x.b);
9 let mut foo: Box<_> = Box::new(Foo { a: 1, b: 2 });
10 let (c, d) = (&mut foo.a, &foo.b);
12 // We explicitly use the references created above to illustrate that the
13 // borrow checker is accepting this code *not* because of artificially
14 // short lifetimes, but rather because it understands that all the
15 // references are of disjoint parts of memory.
22 fn use_mut<T>(_: &mut T) { }
23 fn use_imm<T>(_: &T) { }