3 #![feature(box_syntax)]
5 struct Foo { a: isize, b: isize }
8 let mut x
: Box
<_
> = box Foo { a: 1, b: 2 }
;
9 let (a
, b
) = (&mut x
.a
, &mut x
.b
);
11 let mut foo
: Box
<_
> = box Foo { a: 1, b: 2 }
;
12 let (c
, d
) = (&mut foo
.a
, &foo
.b
);
14 // We explicitly use the references created above to illustrate that the
15 // borrow checker is accepting this code *not* because of artificially
16 // short lifetimes, but rather because it understands that all the
17 // references are of disjoint parts of memory.
24 fn use_mut
<T
>(_
: &mut T
) { }
25 fn use_imm
<T
>(_
: &T
) { }