]>
git.proxmox.com Git - rustc.git/blob - tests/ui/borrowck/borrowck-anon-fields-variant.rs
5 fn distinct_variant() {
6 let mut y
= Foo
::Y(1, 2);
9 Foo
::Y(ref mut a
, _
) => a
,
13 // While `a` and `b` are disjoint, borrowck doesn't know that `a` is not
14 // also used for the discriminant of `Foo`, which it would be if `a` was a
17 //~^ ERROR cannot use `y`
18 Foo
::Y(_
, ref mut b
) => b
,
27 let mut y
= Foo
::Y(1, 2);
30 Foo
::Y(ref mut a
, _
) => a
,
35 //~^ ERROR cannot use `y`
36 Foo
::Y(ref mut b
, _
) => b
,
37 //~^ ERROR cannot borrow `y.0` as mutable